diff --git a/Core/Export/ExportToPython.cpp b/Core/Export/ExportToPython.cpp
index 10305e9d43cdaa26dfaa08eacef407a102bf4558..ad9c0f9c6214a643076ca7c590d596d652308550 100644
--- a/Core/Export/ExportToPython.cpp
+++ b/Core/Export/ExportToPython.cpp
@@ -23,14 +23,12 @@ std::string simulationCode(const ISimulation& simulation,
     std::unique_ptr<ISimulation> sim(simulation.clone());
     sim->prepareSimulation();
 
-    SimulationToPython generator;
-    return generator.generateSimulationCode(*sim, mainFunctionType);
+    return SimulationToPython().generateSimulationCode(*sim, mainFunctionType);
 }
 } // namespace
 
 std::string ExportToPython::generateSampleCode(const MultiLayer& multilayer) {
-    SampleToPython generator;
-    return generator.generateSampleCode(multilayer);
+    return SampleToPython().generateSampleCode(multilayer);
 }
 
 std::string ExportToPython::generateSimulationCode(const ISimulation& simulation) {
diff --git a/Core/Export/SimulationToPython.cpp b/Core/Export/SimulationToPython.cpp
index 01d3e6d85092adf156c5b5e0088335212afb0c5e..65705efcfaf2f2edc43cc5dd5a79ac47b9033831 100644
--- a/Core/Export/SimulationToPython.cpp
+++ b/Core/Export/SimulationToPython.cpp
@@ -120,8 +120,7 @@ std::string defineDetector(const ISimulation* simulation) {
 
         result << indent() << "simulation.setDetector(detector)\n";
     } else
-        throw std::runtime_error("defineDetector() -> Error. "
-                                 "Unknown detector");
+        throw std::runtime_error("defineDetector() -> Error. Unknown detector");
     if (detector->regionOfInterest()) {
         result << indent() << "simulation.setRegionOfInterest("
                << printFunc(detector)(detector->regionOfInterest()->getXlow()) << ", "