diff --git a/Core/Examples/StandardSimulations.cpp b/Core/Examples/StandardSimulations.cpp
index b9c62df5612f3f73d81a3955c83542e3ee8225f5..e02a9d0614a0a279be4a61b2be56355dbf8b4ef5 100644
--- a/Core/Examples/StandardSimulations.cpp
+++ b/Core/Examples/StandardSimulations.cpp
@@ -33,6 +33,7 @@
 #include "Device/Resolution/ScanResolution.h"
 #include "Param/Distrib/Distributions.h"
 #include "Param/Distrib/RangedDistributions.h"
+#include "Resample/Options/SimulationOptions.h"
 #include "Sample/StandardSamples/SampleBuilderFactory.h"
 #include <memory>
 
diff --git a/Core/Export/SimulationToPython.cpp b/Core/Export/SimulationToPython.cpp
index 5892e81b6459254e6ef84ec507672c8b965fe896..e84f1e9dccc8da8ebfd50c863078442dd3e03f95 100644
--- a/Core/Export/SimulationToPython.cpp
+++ b/Core/Export/SimulationToPython.cpp
@@ -35,6 +35,7 @@
 #include "Device/Resolution/ScanResolution.h"
 #include "Param/Distrib/Distributions.h"
 #include "Param/Distrib/RangedDistributions.h"
+#include "Resample/Options/SimulationOptions.h"
 #include <iomanip>
 
 using Py::Fmt::indent;
diff --git a/Core/Fitting/SimDataPair.cpp b/Core/Fitting/SimDataPair.cpp
index f0d454da424cb3d8e3a4f91acec1783029570c73..5c7b61bff4bb6ffd5864032af68f740066481b7b 100644
--- a/Core/Fitting/SimDataPair.cpp
+++ b/Core/Fitting/SimDataPair.cpp
@@ -19,6 +19,7 @@
 #include "Device/Coord/CoordSystem1D.h"
 #include "Device/Coord/CoordSystem2D.h"
 #include "Device/Data/DataUtils.h"
+#include "Device/Detector/IDetector.h"
 
 namespace {
 
diff --git a/Core/Simulation/DepthProbeSimulation.cpp b/Core/Simulation/DepthProbeSimulation.cpp
index 156dee1fe7d67d2932c2970e01c42feef4258438..f874603b0ab48cc4e85e244894d38c6a3581adf7 100644
--- a/Core/Simulation/DepthProbeSimulation.cpp
+++ b/Core/Simulation/DepthProbeSimulation.cpp
@@ -21,6 +21,7 @@
 #include "Device/Coord/CoordSystem2D.h"
 #include "Device/Detector/SpecularDetector1D.h"
 #include "Device/Histo/SimulationResult.h"
+#include "Device/Instrument/Instrument.h"
 #include "Param/Distrib/Distributions.h"
 #include "Resample/Flux/IFlux.h"
 
diff --git a/Core/Simulation/GISASSimulation.cpp b/Core/Simulation/GISASSimulation.cpp
index 7e7593f152202314c46c847d5fa4eb9065543416..69c99a4d3f1ac5c6b86b255b5e7eef7e58b0fef1 100644
--- a/Core/Simulation/GISASSimulation.cpp
+++ b/Core/Simulation/GISASSimulation.cpp
@@ -15,7 +15,9 @@
 #include "Core/Simulation/GISASSimulation.h"
 #include "Device/Coord/CoordSystem2D.h"
 #include "Device/Data/OutputData.h"
+#include "Device/Detector/IDetector.h"
 #include "Device/Histo/SimulationResult.h"
+#include "Device/Instrument/Instrument.h"
 #include "Resample/Element/DiffuseElement.h"
 
 GISASSimulation::GISASSimulation(const Beam& beam, const MultiLayer& sample,
diff --git a/Core/Simulation/ISimulation.cpp b/Core/Simulation/ISimulation.cpp
index a60df0cc46c2bb5963719c4119bc50441522b164..de93f9514daa25d8fc4a5c6e6ba09f5adfd33493 100644
--- a/Core/Simulation/ISimulation.cpp
+++ b/Core/Simulation/ISimulation.cpp
@@ -13,12 +13,14 @@
 //  ************************************************************************************************
 
 #include "Core/Simulation/ISimulation.h"
+#include "Base/Element/PolarizerPair.h"
 #include "Base/Utils/Assert.h"
 #include "Base/Utils/StringUtils.h"
 #include "Core/Background/IBackground.h"
 #include "Core/Computation/IComputation.h"
 #include "Core/Simulation/MPISimulation.h"
 #include "Device/Beam/Beam.h"
+#include "Resample/Options/SimulationOptions.h"
 #include "Resample/Processed/ProcessedSample.h"
 #include "Sample/Multilayer/MultilayerUtils.h"
 #include "Sample/SampleBuilderEngine/ISampleBuilder.h"
@@ -105,20 +107,24 @@ void runComputations(std::vector<std::unique_ptr<IComputation>>& computations)
 //  ************************************************************************************************
 
 ISimulation::ISimulation(const Beam& beam, const MultiLayer& sample, const IDetector& detector)
-    : m_instrument(beam, detector)
+    : m_options(std::make_unique<SimulationOptions>())
+    , m_instrument(beam, detector)
 {
     setSample(sample);
     initialize();
 }
 
 #ifndef SWIG
-ISimulation::ISimulation(const Beam& beam, const IDetector& detector) : m_instrument(beam, detector)
+ISimulation::ISimulation(const Beam& beam, const IDetector& detector)
+    : m_options(std::make_unique<SimulationOptions>())
+    , m_instrument(beam, detector)
 {
     initialize();
 }
 #endif // SWIG
 
 ISimulation::ISimulation()
+    : m_options(std::make_unique<SimulationOptions>())
 {
     initialize();
 }
@@ -131,6 +137,19 @@ void ISimulation::initialize()
     registerChild(&m_sample_provider);
 }
 
+void ISimulation::setOptions(const SimulationOptions& options) {
+    ASSERT(m_options);
+    *m_options = options;
+}
+
+const SimulationOptions& ISimulation::options() const {
+    ASSERT(m_options);
+    return *m_options; }
+
+SimulationOptions& ISimulation::options() {
+    ASSERT(m_options);
+    return *m_options; }
+
 //! Initializes a progress monitor that prints to stdout.
 void ISimulation::setTerminalProgressMonitor()
 {
@@ -170,8 +189,8 @@ void ISimulation::runSimulation()
     m_progress.setExpectedNTicks(param_combinations * total_size);
 
     // restrict calculation to current batch
-    const size_t n_batches = m_options.getNumberOfBatches();
-    const size_t current_batch = m_options.getCurrentBatch();
+    const size_t n_batches = m_options->getNumberOfBatches();
+    const size_t current_batch = m_options->getCurrentBatch();
 
     const size_t batch_start = startIndex(n_batches, current_batch, total_size);
     const size_t batch_size = batchSize(n_batches, current_batch, total_size);
@@ -235,6 +254,12 @@ void ISimulation::setSampleBuilder(const std::shared_ptr<class ISampleBuilder>&
     m_sample_provider.setBuilder(sample_builder);
 }
 
+PolarizerPair ISimulation::polarizerPair() const
+{
+    return {m_instrument.beam().getPolarization(),
+        m_instrument.detector().detectionProperties().analyzerOperator()};
+}
+
 void ISimulation::setBackground(const IBackground& bg)
 {
     m_background.reset(bg.clone());
@@ -293,7 +318,7 @@ void ISimulation::runSingleSimulation(const ProcessedSample& re_sample, size_t b
 {
     initElementVector();
 
-    const size_t n_threads = m_options.getNumberOfThreads();
+    const size_t n_threads = m_options->getNumberOfThreads();
     ASSERT(n_threads > 0);
 
     std::vector<std::unique_ptr<IComputation>> computations;
diff --git a/Core/Simulation/ISimulation.h b/Core/Simulation/ISimulation.h
index 399201f364c94eb8d4844c2bf6d8e8b232b6080d..519d097062afed972e8fe29bc93c1d97526d188c 100644
--- a/Core/Simulation/ISimulation.h
+++ b/Core/Simulation/ISimulation.h
@@ -20,7 +20,6 @@
 #include "Device/Detector/IDetector2D.h"
 #include "Device/Instrument/Instrument.h"
 #include "Param/Distrib/DistributionHandler.h"
-#include "Resample/Options/SimulationOptions.h"
 #include "Sample/SampleBuilderEngine/SampleProvider.h"
 
 template <class T> class OutputData;
@@ -29,7 +28,9 @@ class IComputation;
 class ICoordSystem;
 class ISampleBuilder;
 class MultiLayer;
+class PolarizerPair;
 class ProcessedSample;
+class SimulationOptions;
 class SimulationResult;
 
 //! Abstract base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.
@@ -63,6 +64,8 @@ public:
 
     void setSampleBuilder(const std::shared_ptr<ISampleBuilder>& sample_builder);
 
+    PolarizerPair polarizerPair() const;
+
     void setBackground(const IBackground& bg);
     const IBackground* background() const { return m_background.get(); }
 
@@ -80,9 +83,9 @@ public:
     void addParameterDistribution(const ParameterDistribution& par_distr);
     const std::vector<ParameterDistribution>& getDistributions() const;
 
-    void setOptions(const SimulationOptions& options) { m_options = options; }
-    const SimulationOptions& options() const { return m_options; }
-    SimulationOptions& options() { return m_options; }
+    void setOptions(const SimulationOptions& options);
+    const SimulationOptions& options() const;
+    SimulationOptions& options();
 
     void subscribe(ProgressHandler::Callback_t inform) { m_progress.subscribe(inform); }
     void setTerminalProgressMonitor();
@@ -147,7 +150,7 @@ private:
     virtual std::vector<double> rawResults() const = 0;
     virtual void setRawResults(const std::vector<double>& raw_data) = 0;
 
-    SimulationOptions m_options;
+    std::unique_ptr<SimulationOptions> m_options;
     ProgressHandler m_progress;
     SampleProvider m_sample_provider;
     DistributionHandler m_distribution_handler;
diff --git a/Core/Simulation/ISimulation2D.cpp b/Core/Simulation/ISimulation2D.cpp
index 3f80ba0ce54ee22154bfa3e1c79936c540e9efee..0456a0bb6eb2ef170cddfd35fe10841144da3aea 100644
--- a/Core/Simulation/ISimulation2D.cpp
+++ b/Core/Simulation/ISimulation2D.cpp
@@ -18,6 +18,8 @@
 #include "Core/Computation/DWBAComputation.h"
 #include "Device/Beam/Beam.h"
 #include "Device/Detector/DetectorContext.h"
+#include "Device/Detector/IDetector2D.h"
+#include "Device/Instrument/Instrument.h"
 #include "Resample/Element/DiffuseElement.h"
 
 ISimulation2D::ISimulation2D(const Beam& beam, const MultiLayer& sample, const IDetector& detector)
diff --git a/Core/Simulation/ISimulation2D.h b/Core/Simulation/ISimulation2D.h
index 2bf2f8e33cd20d2cc64262cc3e74066379ae288d..d4bd9610e3d419f68371a830647c19f880a6d3e7 100644
--- a/Core/Simulation/ISimulation2D.h
+++ b/Core/Simulation/ISimulation2D.h
@@ -20,6 +20,9 @@
 #include <memory>
 
 class DetectorContext;
+class DiffuseElement;
+class IDetector2D;
+class IShape2D;
 
 //! Abstract base class of OffSpecularSimulation and GISASSimulation.
 //! Holds the common implementations for simulations with a 2D detector
diff --git a/Core/Simulation/OffSpecularSimulation.cpp b/Core/Simulation/OffSpecularSimulation.cpp
index d3b04b83499fb3775fd453310049d49b6f5da69f..cab4ee9be715a4c5ad59c5827b69e58a7ea05375 100644
--- a/Core/Simulation/OffSpecularSimulation.cpp
+++ b/Core/Simulation/OffSpecularSimulation.cpp
@@ -21,6 +21,7 @@
 #include "Device/Detector/RectangularDetector.h"
 #include "Device/Detector/SphericalDetector.h"
 #include "Device/Histo/SimulationResult.h"
+#include "Device/Instrument/Instrument.h"
 #include "Param/Distrib/Distributions.h"
 #include "Resample/Element/DiffuseElement.h"
 #include "Sample/SampleBuilderEngine/ISampleBuilder.h"
diff --git a/Core/Simulation/SpecularSimulation.cpp b/Core/Simulation/SpecularSimulation.cpp
index d438d118aeea4ef5d80a18e36e25e5f7bff6fb5e..77de63ca0ae66a97e4a370b7da6b9262827fedbe 100644
--- a/Core/Simulation/SpecularSimulation.cpp
+++ b/Core/Simulation/SpecularSimulation.cpp
@@ -24,6 +24,7 @@
 #include "Device/Data/OutputData.h"
 #include "Device/Detector/SpecularDetector1D.h"
 #include "Device/Histo/SimulationResult.h"
+#include "Device/Instrument/Instrument.h"
 #include "Param/Distrib/Distributions.h"
 #include "Resample/Element/SpecularElement.h"
 #include "Resample/Processed/ProcessedSample.h"
@@ -45,16 +46,6 @@ std::unique_ptr<AlphaScan> mangledScan(const AlphaScan& scan, const Beam& beam)
     return std::unique_ptr<AlphaScan>(result);
 }
 
-std::vector<SpecularElement> generateElements(const Instrument& instrument,
-                                              const ISpecularScan& scan)
-{
-    // TODO: remove if statement when pointwise resolution is implemented
-    if (const auto* aScan = dynamic_cast<const AlphaScan*>(&scan))
-        return mangledScan(*aScan, instrument.beam())->generateElements(instrument.polarizerPair());
-
-    return scan.generateElements(instrument.polarizerPair());
-}
-
 } // namespace
 
 //  ************************************************************************************************
@@ -143,7 +134,12 @@ ICoordSystem* SpecularSimulation::createCoordSystem() const
 void SpecularSimulation::initElementVector()
 {
     ASSERT(m_scan);
-    m_eles = generateElements(instrument(), *m_scan);
+
+    // TODO: remove if statement when pointwise resolution is implemented
+    if (const auto* aScan = dynamic_cast<const AlphaScan*>(m_scan.get()))
+        m_eles = mangledScan(*aScan, beam())->generateElements(polarizerPair());
+    else
+        m_eles = m_scan->generateElements(polarizerPair());
 
     if (!m_cache.empty())
         return;
diff --git a/Device/Instrument/Instrument.cpp b/Device/Instrument/Instrument.cpp
index a2a606559e15902a0893871a8c0890bc17545935..541d4031d2e571707b4cd3137a22c13ab8a40fc8 100644
--- a/Device/Instrument/Instrument.cpp
+++ b/Device/Instrument/Instrument.cpp
@@ -13,7 +13,6 @@
 //  ************************************************************************************************
 
 #include "Device/Instrument/Instrument.h"
-#include "Base/Element/PolarizerPair.h"
 #include "Base/Pixel/RectangularPixel.h"
 #include "Device/Beam/Beam.h"
 #include "Device/Coord/CoordSystem2D.h"
@@ -84,11 +83,6 @@ std::vector<const INode*> Instrument::getChildren() const
     return result;
 }
 
-PolarizerPair Instrument::polarizerPair() const
-{
-    return {m_beam->getPolarization(), m_detector->detectionProperties().analyzerOperator()};
-}
-
 void Instrument::setBeamParameters(double wavelength, double alpha_i, double phi_i)
 {
     m_beam->setWavelength(wavelength);
diff --git a/Device/Instrument/Instrument.h b/Device/Instrument/Instrument.h
index 96a36aa444172f5c3ff75d76f69e236ee17435c8..c5dd09a1196200730dd0e34c7b12250496a1ada1 100644
--- a/Device/Instrument/Instrument.h
+++ b/Device/Instrument/Instrument.h
@@ -26,7 +26,6 @@
 class Beam;
 class CoordSystem2D;
 class IDetector;
-class PolarizerPair;
 
 //! Assembles beam, detector and their relative positions with respect to the sample.
 
@@ -59,8 +58,6 @@ public:
     //! init detector with beam settings
     void initDetector();
 
-    PolarizerPair polarizerPair() const;
-
     std::vector<const INode*> getChildren() const override;
 
     CoordSystem2D* createScatteringCoords() const;
diff --git a/GUI/Models/GUIObjectBuilder.cpp b/GUI/Models/GUIObjectBuilder.cpp
index 9a37944a2f73cb8667336a2589814430c4c0f02f..2255a212cd9251546f2868939ff62de79ef937d9 100644
--- a/GUI/Models/GUIObjectBuilder.cpp
+++ b/GUI/Models/GUIObjectBuilder.cpp
@@ -16,6 +16,7 @@
 #include "Base/Const/Units.h"
 #include "Base/Utils/Assert.h"
 #include "Core/Simulation/includeSimulations.h"
+#include "Device/Instrument/Instrument.h"
 #include "GUI/Models/DocumentModel.h"
 #include "GUI/Models/Error.h"
 #include "GUI/Models/GUIDomainSampleVisitor.h"
@@ -23,6 +24,7 @@
 #include "GUI/Models/InstrumentModel.h"
 #include "GUI/Models/SimulationOptionsItem.h"
 #include "GUI/Models/TransformFromDomain.h"
+#include "Resample/Options/SimulationOptions.h"
 
 namespace {
 
diff --git a/GUI/Models/TransformToDomain.cpp b/GUI/Models/TransformToDomain.cpp
index 0035f4f66ac12d55273734b7f3dcc6c9dd4a6b3b..baee7eeb4f9230a4cafe3e57b559c6bffedefd27 100644
--- a/GUI/Models/TransformToDomain.cpp
+++ b/GUI/Models/TransformToDomain.cpp
@@ -36,6 +36,7 @@
 #include "GUI/Models/TransformationItem.h"
 #include "GUI/Models/VectorItem.h"
 #include "Param/Distrib/RangedDistributions.h"
+#include "Resample/Options/SimulationOptions.h"
 #include "Sample/Particle/MesoCrystal.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Particle/ParticleCoreShell.h"
diff --git a/Tests/Performance/Core/Threading.cpp b/Tests/Performance/Core/Threading.cpp
index 8ed635213242d514a35b05e6d58d91fac7198fd8..578760339abdf50054bc796e9d414f9cd1a54585 100644
--- a/Tests/Performance/Core/Threading.cpp
+++ b/Tests/Performance/Core/Threading.cpp
@@ -15,6 +15,7 @@
 #include "Base/Const/Units.h"
 #include "Core/Simulation/GISASSimulation.h"
 #include "Param/Distrib/Distributions.h"
+#include "Resample/Options/SimulationOptions.h"
 #include "Sample/Multilayer/MultiLayer.h"
 #include "Sample/StandardSamples/CylindersBuilder.h"
 #include "Sample/StandardSamples/ParaCrystalBuilder.h"
diff --git a/Tests/Performance/Core/ThreadingComponents.cpp b/Tests/Performance/Core/ThreadingComponents.cpp
index 78fe2cfb14054ab9d77a82fcc3837a2f9564c86b..cfa0225f5966496591d6093618ea2de761ee07f3 100644
--- a/Tests/Performance/Core/ThreadingComponents.cpp
+++ b/Tests/Performance/Core/ThreadingComponents.cpp
@@ -18,6 +18,7 @@
 #include "Device/Detector/RectangularDetector.h"
 #include "Device/Mask/Rectangle.h"
 #include "Param/Distrib/Distributions.h"
+#include "Resample/Options/SimulationOptions.h"
 #include "Sample/Aggregate/InterferenceFunction2DLattice.h"
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/FormFactorFullSphere.h"
diff --git a/Tests/Unit/Core/SpecularScanTest.cpp b/Tests/Unit/Core/SpecularScanTest.cpp
index fb33b031e42919f7e9d2d214ea9225c2144ed070..5e40565c352eb1c682423e66724e3f0a6c209502 100644
--- a/Tests/Unit/Core/SpecularScanTest.cpp
+++ b/Tests/Unit/Core/SpecularScanTest.cpp
@@ -199,36 +199,6 @@ TEST_F(SpecularScanTest, QScanClone)
     }
 }
 
-TEST_F(SpecularScanTest, GenerateSimElements)
-{
-    AlphaScan scan(0.1, std::vector<double>{0.0, 0.2, 0.3});
-    const Instrument instrument;
-    std::vector<SpecularElement> eles = scan.generateElements(instrument.polarizerPair());
-    EXPECT_EQ(eles.size(), scan.numberOfElements());
-    EXPECT_EQ(scan.numberOfElements(), 3u);
-    for (size_t i = 0; i < eles.size(); ++i)
-        EXPECT_TRUE(eles[i].isCalculated());
-
-    const auto scan2_qvector = std::vector<double>{0.0, 0.2, 0.3};
-    QzScan scan2(scan2_qvector);
-    std::vector<SpecularElement> eles2 = scan2.generateElements(instrument.polarizerPair());
-    EXPECT_EQ(eles2.size(), scan2.numberOfElements());
-    EXPECT_EQ(scan2.numberOfElements(), 3u);
-    for (size_t i = 0; i < eles2.size(); ++i)
-        EXPECT_TRUE(eles2[i].isCalculated());
-
-    const double offset = 1.;
-    scan2.setOffset(offset);
-    std::vector<SpecularElement> eles3 = scan2.generateElements(instrument.polarizerPair());
-    SliceStack slices({});
-    slices.addTopSlice(0., MaterialBySLD());
-    for (size_t i = 0; i < eles3.size(); ++i) {
-        const auto generatedKzs = eles3[i].produceKz(slices);
-        EXPECT_EQ(generatedKzs[0].imag(), 0.);
-        EXPECT_EQ(2. * generatedKzs[0].real(), scan2_qvector[i] + offset);
-    }
-}
-
 TEST_F(SpecularScanTest, ErrorInput)
 {
     EXPECT_THROW(AlphaScan(-0.1, std::vector<double>{0.0, 0.2, 0.3}), std::runtime_error);
diff --git a/Tests/Unit/Core/SpecularSimulationTest.cpp b/Tests/Unit/Core/SpecularSimulationTest.cpp
index f1198d2078132d63dfa4aae0bf5c5d6f68262fae..d93c6de948af84783eee24b841332cbd32675230 100644
--- a/Tests/Unit/Core/SpecularSimulationTest.cpp
+++ b/Tests/Unit/Core/SpecularSimulationTest.cpp
@@ -6,6 +6,7 @@
 #include "Core/Scan/AlphaScan.h"
 #include "Core/Scan/QzScan.h"
 #include "Device/Beam/Beam.h"
+#include "Device/Detector/IDetector.h"
 #include "Device/Histo/Histogram1D.h"
 #include "Device/Histo/SimulationResult.h"
 #include "Param/Distrib/Distributions.h"
diff --git a/auto/Wrap/doxygenCore.i b/auto/Wrap/doxygenCore.i
index 66a3dffd792180c7d71181ba8758763da7582f09..2ceac7cc006f9f49e68b68a8ab71c83d7330ed49 100644
--- a/auto/Wrap/doxygenCore.i
+++ b/auto/Wrap/doxygenCore.i
@@ -936,6 +936,9 @@ The MultiLayer object will not be owned by the  ISimulation object.
 %feature("docstring")  ISimulation::setSampleBuilder "void ISimulation::setSampleBuilder(const std::shared_ptr< ISampleBuilder > &sample_builder)
 ";
 
+%feature("docstring")  ISimulation::polarizerPair "PolarizerPair ISimulation::polarizerPair() const
+";
+
 %feature("docstring")  ISimulation::setBackground "void ISimulation::setBackground(const IBackground &bg)
 ";
 
@@ -964,10 +967,10 @@ Returns the results of the simulation in a format that supports unit conversion
 %feature("docstring")  ISimulation::setOptions "void ISimulation::setOptions(const SimulationOptions &options)
 ";
 
-%feature("docstring")  ISimulation::options "const SimulationOptions& ISimulation::options() const
+%feature("docstring")  ISimulation::options "const SimulationOptions & ISimulation::options() const
 ";
 
-%feature("docstring")  ISimulation::options "SimulationOptions& ISimulation::options()
+%feature("docstring")  ISimulation::options "SimulationOptions & ISimulation::options()
 ";
 
 %feature("docstring")  ISimulation::subscribe "void ISimulation::subscribe(ProgressHandler::Callback_t inform)
diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i
index 01b941e4c70198aed717962d30c096ffb722e01c..24dbfa4968d39022355c06bb209d19aae8fe9911 100644
--- a/auto/Wrap/doxygenDevice.i
+++ b/auto/Wrap/doxygenDevice.i
@@ -1620,9 +1620,6 @@ Sets the detector (axes can be overwritten later)
 init detector with beam settings 
 ";
 
-%feature("docstring")  Instrument::polarizerPair "PolarizerPair Instrument::polarizerPair() const
-";
-
 %feature("docstring")  Instrument::getChildren "std::vector< const INode * > Instrument::getChildren() const override
 ";
 
@@ -2304,7 +2301,10 @@ xup:
 x-coordinate of upper right corner
 
 yup: 
-y-coordinate of upper right corner 
+y-coordinate of upper right corner
+
+inverted: 
+swap inside/outside 
 ";
 
 %feature("docstring")  Rectangle::clone "Rectangle* Rectangle::clone() const
diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py
index a1bef13a9d7a9260e909383d08470b56536e9cc3..d5efed45890b63daef244c9d3146db45db6e8819 100644
--- a/auto/Wrap/libBornAgainCore.py
+++ b/auto/Wrap/libBornAgainCore.py
@@ -3526,6 +3526,14 @@ class ISimulation(libBornAgainParam.INode):
         """
         return _libBornAgainCore.ISimulation_setSampleBuilderCpp(self, sample_builder)
 
+    def polarizerPair(self):
+        r"""
+        polarizerPair(ISimulation self) -> PolarizerPair
+        PolarizerPair ISimulation::polarizerPair() const
+
+        """
+        return _libBornAgainCore.ISimulation_polarizerPair(self)
+
     def setBackground(self, bg):
         r"""
         setBackground(ISimulation self, IBackground bg)
@@ -3591,7 +3599,7 @@ class ISimulation(libBornAgainParam.INode):
         r"""
         options(ISimulation self) -> SimulationOptions const
         options(ISimulation self) -> SimulationOptions &
-        SimulationOptions& ISimulation::options()
+        SimulationOptions & ISimulation::options()
 
         """
         return _libBornAgainCore.ISimulation_options(self, *args)
diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp
index 2ab4a84528098a15aa2758a7369c163304a0fe01..5fe2f85b14a4c50c07f68354d88f3a6c348a0e30 100644
--- a/auto/Wrap/libBornAgainCore_wrap.cpp
+++ b/auto/Wrap/libBornAgainCore_wrap.cpp
@@ -3137,74 +3137,75 @@ namespace Swig {
 #define SWIGTYPE_p_OffSpecularSimulation swig_types[37]
 #define SWIGTYPE_p_ParameterDistribution swig_types[38]
 #define SWIGTYPE_p_PoissonNoiseBackground swig_types[39]
-#define SWIGTYPE_p_ProgressHandler__Callback_t swig_types[40]
-#define SWIGTYPE_p_PyBuilderCallback swig_types[41]
-#define SWIGTYPE_p_PyObserverCallback swig_types[42]
-#define SWIGTYPE_p_QzScan swig_types[43]
-#define SWIGTYPE_p_RealLimits swig_types[44]
-#define SWIGTYPE_p_ScanResolution swig_types[45]
-#define SWIGTYPE_p_SimulationOptions swig_types[46]
-#define SWIGTYPE_p_SimulationResult swig_types[47]
-#define SWIGTYPE_p_SpecularSimulation swig_types[48]
-#define SWIGTYPE_p_VarianceConstantFunction swig_types[49]
-#define SWIGTYPE_p_VarianceSimFunction swig_types[50]
-#define SWIGTYPE_p_allocator_type swig_types[51]
-#define SWIGTYPE_p_char swig_types[52]
-#define SWIGTYPE_p_difference_type swig_types[53]
-#define SWIGTYPE_p_first_type swig_types[54]
-#define SWIGTYPE_p_int swig_types[55]
-#define SWIGTYPE_p_key_type swig_types[56]
-#define SWIGTYPE_p_long_long swig_types[57]
-#define SWIGTYPE_p_mapped_type swig_types[58]
-#define SWIGTYPE_p_mumufit__MinimizerResult swig_types[59]
-#define SWIGTYPE_p_mumufit__Parameters swig_types[60]
-#define SWIGTYPE_p_p_PyObject swig_types[61]
-#define SWIGTYPE_p_second_type swig_types[62]
-#define SWIGTYPE_p_short swig_types[63]
-#define SWIGTYPE_p_signed_char swig_types[64]
-#define SWIGTYPE_p_size_type swig_types[65]
-#define SWIGTYPE_p_std__allocatorT_AxisInfo_t swig_types[66]
-#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_double_t_t swig_types[67]
-#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t swig_types[68]
-#define SWIGTYPE_p_std__allocatorT_INode_const_p_t swig_types[69]
-#define SWIGTYPE_p_std__allocatorT_INode_p_t swig_types[70]
-#define SWIGTYPE_p_std__allocatorT_double_t swig_types[71]
-#define SWIGTYPE_p_std__allocatorT_int_t swig_types[72]
-#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[73]
-#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[74]
-#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[75]
-#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[76]
-#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[77]
-#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[78]
-#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[79]
-#define SWIGTYPE_p_std__complexT_double_t swig_types[80]
-#define SWIGTYPE_p_std__invalid_argument swig_types[81]
-#define SWIGTYPE_p_std__lessT_std__string_t swig_types[82]
-#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[83]
-#define SWIGTYPE_p_std__pairT_double_double_t swig_types[84]
-#define SWIGTYPE_p_std__shared_ptrT_ISampleBuilder_t swig_types[85]
-#define SWIGTYPE_p_std__vectorT_AxisInfo_std__allocatorT_AxisInfo_t_t swig_types[86]
-#define SWIGTYPE_p_std__vectorT_BasicVector3DT_double_t_std__allocatorT_BasicVector3DT_double_t_t_t swig_types[87]
-#define SWIGTYPE_p_std__vectorT_BasicVector3DT_std__complexT_double_t_t_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t_t swig_types[88]
-#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[89]
-#define SWIGTYPE_p_std__vectorT_INode_p_std__allocatorT_INode_p_t_t swig_types[90]
-#define SWIGTYPE_p_std__vectorT_ParameterDistribution_std__allocatorT_ParameterDistribution_t_t swig_types[91]
-#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[92]
-#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[93]
-#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[94]
-#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[95]
-#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[96]
-#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[97]
-#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[98]
-#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[99]
-#define SWIGTYPE_p_swig__SwigPyIterator swig_types[100]
-#define SWIGTYPE_p_unsigned_char swig_types[101]
-#define SWIGTYPE_p_unsigned_int swig_types[102]
-#define SWIGTYPE_p_unsigned_long_long swig_types[103]
-#define SWIGTYPE_p_unsigned_short swig_types[104]
-#define SWIGTYPE_p_value_type swig_types[105]
-static swig_type_info *swig_types[107];
-static swig_module_info swig_module = {swig_types, 106, 0, 0, 0, 0};
+#define SWIGTYPE_p_PolarizerPair swig_types[40]
+#define SWIGTYPE_p_ProgressHandler__Callback_t swig_types[41]
+#define SWIGTYPE_p_PyBuilderCallback swig_types[42]
+#define SWIGTYPE_p_PyObserverCallback swig_types[43]
+#define SWIGTYPE_p_QzScan swig_types[44]
+#define SWIGTYPE_p_RealLimits swig_types[45]
+#define SWIGTYPE_p_ScanResolution swig_types[46]
+#define SWIGTYPE_p_SimulationOptions swig_types[47]
+#define SWIGTYPE_p_SimulationResult swig_types[48]
+#define SWIGTYPE_p_SpecularSimulation swig_types[49]
+#define SWIGTYPE_p_VarianceConstantFunction swig_types[50]
+#define SWIGTYPE_p_VarianceSimFunction swig_types[51]
+#define SWIGTYPE_p_allocator_type swig_types[52]
+#define SWIGTYPE_p_char swig_types[53]
+#define SWIGTYPE_p_difference_type swig_types[54]
+#define SWIGTYPE_p_first_type swig_types[55]
+#define SWIGTYPE_p_int swig_types[56]
+#define SWIGTYPE_p_key_type swig_types[57]
+#define SWIGTYPE_p_long_long swig_types[58]
+#define SWIGTYPE_p_mapped_type swig_types[59]
+#define SWIGTYPE_p_mumufit__MinimizerResult swig_types[60]
+#define SWIGTYPE_p_mumufit__Parameters swig_types[61]
+#define SWIGTYPE_p_p_PyObject swig_types[62]
+#define SWIGTYPE_p_second_type swig_types[63]
+#define SWIGTYPE_p_short swig_types[64]
+#define SWIGTYPE_p_signed_char swig_types[65]
+#define SWIGTYPE_p_size_type swig_types[66]
+#define SWIGTYPE_p_std__allocatorT_AxisInfo_t swig_types[67]
+#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_double_t_t swig_types[68]
+#define SWIGTYPE_p_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t swig_types[69]
+#define SWIGTYPE_p_std__allocatorT_INode_const_p_t swig_types[70]
+#define SWIGTYPE_p_std__allocatorT_INode_p_t swig_types[71]
+#define SWIGTYPE_p_std__allocatorT_double_t swig_types[72]
+#define SWIGTYPE_p_std__allocatorT_int_t swig_types[73]
+#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[74]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[75]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[76]
+#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[77]
+#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[78]
+#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[79]
+#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[80]
+#define SWIGTYPE_p_std__complexT_double_t swig_types[81]
+#define SWIGTYPE_p_std__invalid_argument swig_types[82]
+#define SWIGTYPE_p_std__lessT_std__string_t swig_types[83]
+#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[84]
+#define SWIGTYPE_p_std__pairT_double_double_t swig_types[85]
+#define SWIGTYPE_p_std__shared_ptrT_ISampleBuilder_t swig_types[86]
+#define SWIGTYPE_p_std__vectorT_AxisInfo_std__allocatorT_AxisInfo_t_t swig_types[87]
+#define SWIGTYPE_p_std__vectorT_BasicVector3DT_double_t_std__allocatorT_BasicVector3DT_double_t_t_t swig_types[88]
+#define SWIGTYPE_p_std__vectorT_BasicVector3DT_std__complexT_double_t_t_std__allocatorT_BasicVector3DT_std__complexT_double_t_t_t_t swig_types[89]
+#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[90]
+#define SWIGTYPE_p_std__vectorT_INode_p_std__allocatorT_INode_p_t_t swig_types[91]
+#define SWIGTYPE_p_std__vectorT_ParameterDistribution_std__allocatorT_ParameterDistribution_t_t swig_types[92]
+#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[93]
+#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[94]
+#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[95]
+#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[96]
+#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[97]
+#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[98]
+#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[99]
+#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[100]
+#define SWIGTYPE_p_swig__SwigPyIterator swig_types[101]
+#define SWIGTYPE_p_unsigned_char swig_types[102]
+#define SWIGTYPE_p_unsigned_int swig_types[103]
+#define SWIGTYPE_p_unsigned_long_long swig_types[104]
+#define SWIGTYPE_p_unsigned_short swig_types[105]
+#define SWIGTYPE_p_value_type swig_types[106]
+static swig_type_info *swig_types[108];
+static swig_module_info swig_module = {swig_types, 107, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -39103,6 +39104,29 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_ISimulation_polarizerPair(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  ISimulation *arg1 = (ISimulation *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject *swig_obj[1] ;
+  PolarizerPair result;
+  
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ISimulation, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation_polarizerPair" "', argument " "1"" of type '" "ISimulation const *""'"); 
+  }
+  arg1 = reinterpret_cast< ISimulation * >(argp1);
+  result = ((ISimulation const *)arg1)->polarizerPair();
+  resultobj = SWIG_NewPointerObj((new PolarizerPair(static_cast< const PolarizerPair& >(result))), SWIGTYPE_p_PolarizerPair, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_ISimulation_setBackground(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   ISimulation *arg1 = (ISimulation *) 0 ;
@@ -44239,6 +44263,11 @@ static PyMethodDef SwigMethods[] = {
 		"void ISimulation::setSampleBuilder(const std::shared_ptr< ISampleBuilder > &sample_builder)\n"
 		"\n"
 		""},
+	 { "ISimulation_polarizerPair", _wrap_ISimulation_polarizerPair, METH_O, "\n"
+		"ISimulation_polarizerPair(ISimulation self) -> PolarizerPair\n"
+		"PolarizerPair ISimulation::polarizerPair() const\n"
+		"\n"
+		""},
 	 { "ISimulation_setBackground", _wrap_ISimulation_setBackground, METH_VARARGS, "\n"
 		"ISimulation_setBackground(ISimulation self, IBackground bg)\n"
 		"void ISimulation::setBackground(const IBackground &bg)\n"
@@ -44282,7 +44311,7 @@ static PyMethodDef SwigMethods[] = {
 	 { "ISimulation_options", _wrap_ISimulation_options, METH_VARARGS, "\n"
 		"ISimulation_options(ISimulation self) -> SimulationOptions const\n"
 		"ISimulation_options(ISimulation self) -> SimulationOptions &\n"
-		"SimulationOptions& ISimulation::options()\n"
+		"SimulationOptions & ISimulation::options()\n"
 		"\n"
 		""},
 	 { "ISimulation_subscribe", _wrap_ISimulation_subscribe, METH_VARARGS, "\n"
@@ -45067,6 +45096,7 @@ static swig_type_info _swigt__p_MultiLayer = {"_p_MultiLayer", "MultiLayer *", 0
 static swig_type_info _swigt__p_OffSpecularSimulation = {"_p_OffSpecularSimulation", "OffSpecularSimulation *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_ParameterDistribution = {"_p_ParameterDistribution", "ParameterDistribution *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_PoissonNoiseBackground = {"_p_PoissonNoiseBackground", "PoissonNoiseBackground *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_PolarizerPair = {"_p_PolarizerPair", "PolarizerPair *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_ProgressHandler__Callback_t = {"_p_ProgressHandler__Callback_t", "ProgressHandler::Callback_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_PyBuilderCallback = {"_p_PyBuilderCallback", "PyBuilderCallback *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_PyObserverCallback = {"_p_PyObserverCallback", "PyObserverCallback *", 0, 0, (void*)0, 0};
@@ -45175,6 +45205,7 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_OffSpecularSimulation,
   &_swigt__p_ParameterDistribution,
   &_swigt__p_PoissonNoiseBackground,
+  &_swigt__p_PolarizerPair,
   &_swigt__p_ProgressHandler__Callback_t,
   &_swigt__p_PyBuilderCallback,
   &_swigt__p_PyObserverCallback,
@@ -45283,6 +45314,7 @@ static swig_cast_info _swigc__p_MultiLayer[] = {  {&_swigt__p_MultiLayer, 0, 0,
 static swig_cast_info _swigc__p_OffSpecularSimulation[] = {  {&_swigt__p_OffSpecularSimulation, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ParameterDistribution[] = {  {&_swigt__p_ParameterDistribution, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_PoissonNoiseBackground[] = {  {&_swigt__p_PoissonNoiseBackground, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_PolarizerPair[] = {  {&_swigt__p_PolarizerPair, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ProgressHandler__Callback_t[] = {  {&_swigt__p_ProgressHandler__Callback_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_PyBuilderCallback[] = {  {&_swigt__p_PyBuilderCallback, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_PyObserverCallback[] = {  {&_swigt__p_PyObserverCallback, 0, 0, 0},{0, 0, 0, 0}};
@@ -45391,6 +45423,7 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_OffSpecularSimulation,
   _swigc__p_ParameterDistribution,
   _swigc__p_PoissonNoiseBackground,
+  _swigc__p_PolarizerPair,
   _swigc__p_ProgressHandler__Callback_t,
   _swigc__p_PyBuilderCallback,
   _swigc__p_PyObserverCallback,
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index ab5597e39c3b53b8a475cf108572baedf00e0219..14eb174cfc6d587dce926e693627cfad7d426af4 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -3462,7 +3462,10 @@ class Rectangle(IShape2D):
         x-coordinate of upper right corner
 
         yup: 
-        y-coordinate of upper right corner 
+        y-coordinate of upper right corner
+
+        inverted: 
+        swap inside/outside 
 
         """
         _libBornAgainDevice.Rectangle_swiginit(self, _libBornAgainDevice.new_Rectangle(xlow, ylow, xup, yup, inverted))
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index 9ca119cf03e79c3a443d9d867c8fa6b196c1b595..ae273b9b312d3dcd4beb0776edb89b881d7b90ae 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -45383,7 +45383,10 @@ static PyMethodDef SwigMethods[] = {
 		"x-coordinate of upper right corner\n"
 		"\n"
 		"yup: \n"
-		"y-coordinate of upper right corner \n"
+		"y-coordinate of upper right corner\n"
+		"\n"
+		"inverted: \n"
+		"swap inside/outside \n"
 		"\n"
 		""},
 	 { "Rectangle_clone", _wrap_Rectangle_clone, METH_O, "\n"