diff --git a/Core/FormFactors/FormFactorAnisoPyramid.cpp b/Core/FormFactors/FormFactorAnisoPyramid.cpp
index 7c3ff67acb5d3a51f932ca4c08fe50a2a06b13fb..eaca8168af97de045369d8067101c3d657c5876e 100644
--- a/Core/FormFactors/FormFactorAnisoPyramid.cpp
+++ b/Core/FormFactors/FormFactorAnisoPyramid.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorAnisoPyramid.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorAnisoPyramid.h"
 
 const PolyhedralTopology FormFactorAnisoPyramid::topology = {
     {
diff --git a/Core/FormFactors/FormFactorBox.cpp b/Core/FormFactors/FormFactorBox.cpp
index ff31d7ae9a6b4f97044e88652e1d8ecfdbe1e1eb..5693024d3b1798854b113b3f0f633aa32d729149 100644
--- a/Core/FormFactors/FormFactorBox.cpp
+++ b/Core/FormFactors/FormFactorBox.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorBox.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorBox.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorCone.cpp b/Core/FormFactors/FormFactorCone.cpp
index 5d04994a26c4fb7b122d5d77a6a0e5ec52fbca27..b887c51d92215e926e1645b43fdc06fa07fd88c4 100644
--- a/Core/FormFactors/FormFactorCone.cpp
+++ b/Core/FormFactors/FormFactorCone.cpp
@@ -13,10 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorCone.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
-#include "IntegratorComplex.h"
+#include "FormFactorCone.h"
 
 //! @brief Cone constructor
 //! @param radius of Cone's base
diff --git a/Core/FormFactors/FormFactorCone.h b/Core/FormFactors/FormFactorCone.h
index 43185000f3e18532ec661962b72f1a6d0ee0bc86..d1dfed947816861166806268c15920577d23b5bb 100644
--- a/Core/FormFactors/FormFactorCone.h
+++ b/Core/FormFactors/FormFactorCone.h
@@ -16,8 +16,8 @@
 #ifndef FORMFACTORCONE_H
 #define FORMFACTORCONE_H
 
-#include "FormFactorPolyhedron.h"
-
+#include "IFormFactorBorn.h"
+#include "IntegratorComplex.h"
 
 // Forward declaration to prevent IntegratorComplex.h to be parsed for Python API:
 template <class T> class IntegratorComplex;
diff --git a/Core/FormFactors/FormFactorCone6.cpp b/Core/FormFactors/FormFactorCone6.cpp
index ac04b581e5359206080fcb5223c89080130e63a9..88551b3d5f14651995ebc46586a2e01842f5573b 100644
--- a/Core/FormFactors/FormFactorCone6.cpp
+++ b/Core/FormFactors/FormFactorCone6.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorCone6.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorCone6.h"
 
 const PolyhedralTopology FormFactorCone6::topology = {
     {
diff --git a/Core/FormFactors/FormFactorCrystal.h b/Core/FormFactors/FormFactorCrystal.h
index e4a79d2b60457d194c116ff0492cb8885a62f262..3b421f88b967ab9d9394a8d764ef3597a64ab712 100644
--- a/Core/FormFactors/FormFactorCrystal.h
+++ b/Core/FormFactors/FormFactorCrystal.h
@@ -16,8 +16,8 @@
 #ifndef FORMFACTORCRYSTAL_H
 #define FORMFACTORCRYSTAL_H
 
-#include "IFormFactorBorn.h"
 #include "Crystal.h"
+#include "IFormFactorBorn.h"
 
 //! @class FormFactorCrystal
 //! @ingroup formfactors
diff --git a/Core/FormFactors/FormFactorCuboctahedron.cpp b/Core/FormFactors/FormFactorCuboctahedron.cpp
index 5b5a20aeefc85cb9261866db38545480ffad10ce..8d922b0d2409139b20b6aefddfef7227a9a59d6a 100644
--- a/Core/FormFactors/FormFactorCuboctahedron.cpp
+++ b/Core/FormFactors/FormFactorCuboctahedron.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorCuboctahedron.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorCuboctahedron.h"
 
 const PolyhedralTopology FormFactorCuboctahedron::topology = {
     {
diff --git a/Core/FormFactors/FormFactorCylinder.cpp b/Core/FormFactors/FormFactorCylinder.cpp
index c9f0bac319ba6a9be50d7f0009c97d7af48e7109..95c0c030841367ea3bd34ee6bcb85e2d2c4c5301 100644
--- a/Core/FormFactors/FormFactorCylinder.cpp
+++ b/Core/FormFactors/FormFactorCylinder.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorCylinder.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorCylinder.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorDWBA.cpp b/Core/FormFactors/FormFactorDWBA.cpp
index d441a2167dcf58f89ec6d8760d63b5f4e354a025..c9f4ae20d13bed812d74924fdf36c7115b2ba6c3 100644
--- a/Core/FormFactors/FormFactorDWBA.cpp
+++ b/Core/FormFactors/FormFactorDWBA.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorDWBA.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorDWBA.h"
 
 
 FormFactorDWBA::FormFactorDWBA(const IFormFactor& form_factor)
diff --git a/Core/FormFactors/FormFactorDWBAPol.cpp b/Core/FormFactors/FormFactorDWBAPol.cpp
index 83051a04560d185019b3bf819ae5af45b3717bab..d22ac8adfb25b3582faffd87b289c30454a3df4c 100644
--- a/Core/FormFactors/FormFactorDWBAPol.cpp
+++ b/Core/FormFactors/FormFactorDWBAPol.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorDWBAPol.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorDWBAPol.h"
 
 FormFactorDWBAPol::FormFactorDWBAPol(const IFormFactor &form_factor)
 : mp_form_factor(form_factor.clone())
diff --git a/Core/FormFactors/FormFactorDecoratorDebyeWaller.cpp b/Core/FormFactors/FormFactorDecoratorDebyeWaller.cpp
index dd47d5c8e142566f2c03255acd8e012572f7af90..f305af7d51f0dc457e4347a941f17bb1209db881 100644
--- a/Core/FormFactors/FormFactorDecoratorDebyeWaller.cpp
+++ b/Core/FormFactors/FormFactorDecoratorDebyeWaller.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorDecoratorDebyeWaller.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorDecoratorDebyeWaller.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorDecoratorFactor.h b/Core/FormFactors/FormFactorDecoratorFactor.h
index b1902fda5ea5947975b8277fa670a891c3f9e145..4bc96d36bb5b3cec3cbf04faf5ef7c390a5a2d41 100644
--- a/Core/FormFactors/FormFactorDecoratorFactor.h
+++ b/Core/FormFactors/FormFactorDecoratorFactor.h
@@ -16,8 +16,8 @@
 #ifndef FORMFACTORDECORATORFACTOR_H
 #define FORMFACTORDECORATORFACTOR_H
 
-#include "IFormFactorDecorator.h"
 #include "BornAgainNamespace.h"
+#include "IFormFactorDecorator.h"
 
 //! @class FormFactorDecoratorFactor
 //! @ingroup formfactors_internal
diff --git a/Core/FormFactors/FormFactorDecoratorMultiPositionFactor.cpp b/Core/FormFactors/FormFactorDecoratorMultiPositionFactor.cpp
index a33c00d469d379fc5e3bba9b709b8e2d78db651f..4cdf5bb7ed817d2c03843d1a66648f5ce115c5c2 100644
--- a/Core/FormFactors/FormFactorDecoratorMultiPositionFactor.cpp
+++ b/Core/FormFactors/FormFactorDecoratorMultiPositionFactor.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorDecoratorMultiPositionFactor.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorDecoratorMultiPositionFactor.h"
 
 FormFactorDecoratorMultiPositionFactor::FormFactorDecoratorMultiPositionFactor(
     const IFormFactor &form_factor, std::vector<kvector_t> positions)
diff --git a/Core/FormFactors/FormFactorDecoratorPositionFactor.h b/Core/FormFactors/FormFactorDecoratorPositionFactor.h
index 53de0896806065b2e4092fa53edd95d6b49f3cb0..3f514af3c0171138bf3abb944ecdbb91fdd7997b 100644
--- a/Core/FormFactors/FormFactorDecoratorPositionFactor.h
+++ b/Core/FormFactors/FormFactorDecoratorPositionFactor.h
@@ -16,8 +16,8 @@
 #ifndef FORMFACTORDECORATORPOSITIONFACTOR_H
 #define FORMFACTORDECORATORPOSITIONFACTOR_H
 
-#include "IFormFactorDecorator.h"
 #include "BornAgainNamespace.h"
+#include "IFormFactorDecorator.h"
 
 //! @class FormFactorDecoratorPositionFactor
 //! @ingroup formfactors_internal
diff --git a/Core/FormFactors/FormFactorDecoratorRotation.cpp b/Core/FormFactors/FormFactorDecoratorRotation.cpp
index 4d0291abe5d425e7f3d3d63e5fd7b17345593532..55a87b24ed1cc15b2e538cb73a057b9680bcdf0d 100644
--- a/Core/FormFactors/FormFactorDecoratorRotation.cpp
+++ b/Core/FormFactors/FormFactorDecoratorRotation.cpp
@@ -14,8 +14,8 @@
 // ************************************************************************** //
 
 #include <memory>
-#include "FormFactorDecoratorRotation.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorDecoratorRotation.h"
 
 FormFactorDecoratorRotation::FormFactorDecoratorRotation(
     const IFormFactor& form_factor, const IRotation& transform)
diff --git a/Core/FormFactors/FormFactorDodecahedron.cpp b/Core/FormFactors/FormFactorDodecahedron.cpp
index d0d4d084361dbb6e0c8c9c6f520cbeee46cc21b7..c55abdd78c84f676d4a37b2763b5f8c6c49249f3 100644
--- a/Core/FormFactors/FormFactorDodecahedron.cpp
+++ b/Core/FormFactors/FormFactorDodecahedron.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorDodecahedron.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorDodecahedron.h"
 
 const PolyhedralTopology FormFactorDodecahedron::topology = {
     {
diff --git a/Core/FormFactors/FormFactorEllipsoidalCylinder.cpp b/Core/FormFactors/FormFactorEllipsoidalCylinder.cpp
index 2c35e14f9c21983a763d3657808d25fdfa8e5048..a1895bc2a43f19f325a453ed0e7002686ced61bd 100644
--- a/Core/FormFactors/FormFactorEllipsoidalCylinder.cpp
+++ b/Core/FormFactors/FormFactorEllipsoidalCylinder.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorEllipsoidalCylinder.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorEllipsoidalCylinder.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorFullSphere.cpp b/Core/FormFactors/FormFactorFullSphere.cpp
index 008ae75aa67c7ba671db1e4f89ec8de29904479d..6b6612f8c682c955d28d5ef320a92c54827617c4 100644
--- a/Core/FormFactors/FormFactorFullSphere.cpp
+++ b/Core/FormFactors/FormFactorFullSphere.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorFullSphere.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorFullSphere.h"
 
 #ifdef POLYHEDRAL_DIAGNOSTIC
 #endif
diff --git a/Core/FormFactors/FormFactorFullSpheroid.cpp b/Core/FormFactors/FormFactorFullSpheroid.cpp
index 4e7b5552aa4b5bb20cbcf49a3a76030feb2301cc..8cc0e586c06b83db679409456377c5b41bc8bab8 100644
--- a/Core/FormFactors/FormFactorFullSpheroid.cpp
+++ b/Core/FormFactors/FormFactorFullSpheroid.cpp
@@ -13,10 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorFullSpheroid.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
-#include "IntegratorComplex.h"
+#include "FormFactorFullSpheroid.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorFullSpheroid.h b/Core/FormFactors/FormFactorFullSpheroid.h
index 0add1a4f33ea723c4ac2d68d13be95bf5e39faae..733b50592bdefad9be99d22935c33c0660d0de7a 100644
--- a/Core/FormFactors/FormFactorFullSpheroid.h
+++ b/Core/FormFactors/FormFactorFullSpheroid.h
@@ -18,9 +18,7 @@
 
 #include <memory>
 #include "IFormFactorBorn.h"
-
-// Forward declaration to prevent IntegratorComplex.h to be parsed for Python API:
-template <class T> class IntegratorComplex;
+#include "IntegratorComplex.h"
 
 //! @class FormFactorFullSpheroid
 //! @ingroup formfactors
@@ -75,5 +73,3 @@ inline double FormFactorFullSpheroid::getRadius() const
 }
 
 #endif // FORMFACTORFULLSPHEROID_H
-
-
diff --git a/Core/FormFactors/FormFactorGauss.cpp b/Core/FormFactors/FormFactorGauss.cpp
index c0585592e287d1f8c1ed2e7e37c562c758960154..8cd3cf549494d2523cebe0f352f518e0979b3094 100644
--- a/Core/FormFactors/FormFactorGauss.cpp
+++ b/Core/FormFactors/FormFactorGauss.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorGauss.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorGauss.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorHemiEllipsoid.cpp b/Core/FormFactors/FormFactorHemiEllipsoid.cpp
index 47e707aa4e2c8cf51785c0be6bd389a9f6aa6ffb..363ec97924afa422a0d50359ad721f069eaeff70 100644
--- a/Core/FormFactors/FormFactorHemiEllipsoid.cpp
+++ b/Core/FormFactors/FormFactorHemiEllipsoid.cpp
@@ -13,11 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorHemiEllipsoid.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
-#include "IntegratorComplex.h"
-
+#include "FormFactorHemiEllipsoid.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorHemiEllipsoid.h b/Core/FormFactors/FormFactorHemiEllipsoid.h
index 80d3b4c3984f85ef6ede7f78ae8a194f4944cfeb..6dfea43b47410e4409b011e66095bfe6830a11d1 100644
--- a/Core/FormFactors/FormFactorHemiEllipsoid.h
+++ b/Core/FormFactors/FormFactorHemiEllipsoid.h
@@ -18,9 +18,7 @@
 
 #include <memory>
 #include "IFormFactorBorn.h"
-
-// Forward declaration to prevent IntegratorComplex.h to be parsed for Python API:
-template <class T> class IntegratorComplex;
+#include "IntegratorComplex.h"
 
 //! @class FormFactorHemiEllipsoid
 //! @ingroup formfactors
diff --git a/Core/FormFactors/FormFactorIcosahedron.cpp b/Core/FormFactors/FormFactorIcosahedron.cpp
index 467858544dd26c9ab3f11bfc58ceffc666e3e57a..8275ad3520b9e3757e4733593f3000ea38382311 100644
--- a/Core/FormFactors/FormFactorIcosahedron.cpp
+++ b/Core/FormFactors/FormFactorIcosahedron.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorIcosahedron.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorIcosahedron.h"
 
 const PolyhedralTopology FormFactorIcosahedron::topology = {
     {
diff --git a/Core/FormFactors/FormFactorLongBoxGauss.cpp b/Core/FormFactors/FormFactorLongBoxGauss.cpp
index 5aaba42ecc899f3cc42d6a482e42fd95a3b3ecc6..e213574a813ae06ab4a83de78fcaa1dfad7f5679 100644
--- a/Core/FormFactors/FormFactorLongBoxGauss.cpp
+++ b/Core/FormFactors/FormFactorLongBoxGauss.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorLongBoxGauss.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorLongBoxGauss.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorLongBoxLorentz.cpp b/Core/FormFactors/FormFactorLongBoxLorentz.cpp
index 6da64b1ca640e0c1b874037bb738f24aadd2c0d3..9bfdf15aad6b19ff1b8cc61037e17760843fcf31 100644
--- a/Core/FormFactors/FormFactorLongBoxLorentz.cpp
+++ b/Core/FormFactors/FormFactorLongBoxLorentz.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorLongBoxLorentz.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorLongBoxLorentz.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorLongRipple1Gauss.cpp b/Core/FormFactors/FormFactorLongRipple1Gauss.cpp
index a2f6b915fc8a84ea1ae6eff5c227d389c56800bb..42d83aaad8c56f7e9bb4ba982ae65bce3fb0a92a 100644
--- a/Core/FormFactors/FormFactorLongRipple1Gauss.cpp
+++ b/Core/FormFactors/FormFactorLongRipple1Gauss.cpp
@@ -13,11 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorLongRipple1Gauss.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
-#include "IntegratorComplex.h"
-
+#include "FormFactorLongRipple1Gauss.h"
 
 using namespace  BornAgain;
 
@@ -103,5 +101,5 @@ complex_t FormFactorLongRipple1Gauss::evaluate_for_q(const cvector_t q) const
 
     // numerical integration otherwise
     complex_t integral = mP_integrator->integrate(0, m_height);
-    return factor*integral;
+    return factor * integral;
 }
diff --git a/Core/FormFactors/FormFactorLongRipple1Gauss.h b/Core/FormFactors/FormFactorLongRipple1Gauss.h
index d2ea26d2da47d03588d9086d317c4617e01434bb..dab77800ea6a0e9b32def9bac16766a27607b908 100644
--- a/Core/FormFactors/FormFactorLongRipple1Gauss.h
+++ b/Core/FormFactors/FormFactorLongRipple1Gauss.h
@@ -18,9 +18,7 @@
 
 #include <memory>
 #include "IFormFactorBorn.h"
-
-// Forward declaration to prevent IntegratorComplex.h to be parsed for Python API:
-template <class T> class IntegratorComplex;
+#include "IntegratorComplex.h"
 
 //! @class FormFactorLongRipple1Gauss
 //! @ingroup formfactors
@@ -37,9 +35,9 @@ public:
 
     virtual ~FormFactorLongRipple1Gauss();
 
-    virtual FormFactorLongRipple1Gauss *clone() const;
+    virtual FormFactorLongRipple1Gauss* clone() const;
 
-    virtual void accept(ISampleVisitor *visitor) const;
+    virtual void accept(ISampleVisitor* visitor) const;
 
     virtual double getRadius() const;
 
@@ -84,5 +82,3 @@ inline double FormFactorLongRipple1Gauss::getLength() const
 }
 
 #endif // FORMFACTORLONGRIPPLE1GAUSS_H
-
-
diff --git a/Core/FormFactors/FormFactorLongRipple1Lorentz.cpp b/Core/FormFactors/FormFactorLongRipple1Lorentz.cpp
index 7d4a34c76c23f2a0df603955316032ecc5416d4d..f6b2ed3185f78d5c01cc578471a05758858cd79e 100644
--- a/Core/FormFactors/FormFactorLongRipple1Lorentz.cpp
+++ b/Core/FormFactors/FormFactorLongRipple1Lorentz.cpp
@@ -13,11 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorLongRipple1Lorentz.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
-#include "IntegratorComplex.h"
-
+#include "FormFactorLongRipple1Lorentz.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorLongRipple1Lorentz.h b/Core/FormFactors/FormFactorLongRipple1Lorentz.h
index 7c9d6d8a0fcce8e9d1e28e0362062ef25270ef87..06cf8da7a73341d0615ffacc0b7e950fb4c92e47 100644
--- a/Core/FormFactors/FormFactorLongRipple1Lorentz.h
+++ b/Core/FormFactors/FormFactorLongRipple1Lorentz.h
@@ -18,9 +18,7 @@
 
 #include <memory>
 #include "IFormFactorBorn.h"
-
-// Forward declaration to prevent IntegratorComplex.h to be parsed for Python API:
-template <class T> class IntegratorComplex;
+#include "IntegratorComplex.h"
 
 //! @class FormFactorLongRipple1Lorentz
 //! @ingroup formfactors
@@ -84,5 +82,3 @@ inline double FormFactorLongRipple1Lorentz::getLength() const
 }
 
 #endif // FORMFACTORLONGRIPPLE1LORENTZ_H
-
-
diff --git a/Core/FormFactors/FormFactorLongRipple2Gauss.cpp b/Core/FormFactors/FormFactorLongRipple2Gauss.cpp
index dfd4cf10f2de691a74c1be6a0d5117810a3b8e89..32cc737b28b2d5c39c37e9d6ac6d401a5ca598c6 100644
--- a/Core/FormFactors/FormFactorLongRipple2Gauss.cpp
+++ b/Core/FormFactors/FormFactorLongRipple2Gauss.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorLongRipple2Gauss.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorLongRipple2Gauss.h"
 
 
 using namespace  BornAgain;
diff --git a/Core/FormFactors/FormFactorLongRipple2Lorentz.cpp b/Core/FormFactors/FormFactorLongRipple2Lorentz.cpp
index a315032adf1f394aee29ba80a289ab270caa945e..8364c08c71a962c1401d248948b49c30fb435254 100644
--- a/Core/FormFactors/FormFactorLongRipple2Lorentz.cpp
+++ b/Core/FormFactors/FormFactorLongRipple2Lorentz.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorLongRipple2Lorentz.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorLongRipple2Lorentz.h"
 
 
 using namespace  BornAgain;
diff --git a/Core/FormFactors/FormFactorLorentz.cpp b/Core/FormFactors/FormFactorLorentz.cpp
index 1ecd0feca91484ac5cf2fe3788cbd91663a2a7c7..51eb70793026d006ce0fa87a4f5879b68e02e6c1 100644
--- a/Core/FormFactors/FormFactorLorentz.cpp
+++ b/Core/FormFactors/FormFactorLorentz.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorLorentz.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorLorentz.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorPolyhedron.cpp b/Core/FormFactors/FormFactorPolyhedron.cpp
index 60159f15bed714cba46571eb5076a8fe9823ebbe..83d4f2a60f444209bbd1e245aae9578c73dc145d 100644
--- a/Core/FormFactors/FormFactorPolyhedron.cpp
+++ b/Core/FormFactors/FormFactorPolyhedron.cpp
@@ -18,9 +18,9 @@
 //! "Form factor (Fourier shape transform) of polygon and polyhedron."
 
 #include <iomanip>
-#include "Precomputed.h"
-#include "MathFunctions.h"
 #include "BornAgainNamespace.h"
+#include "MathFunctions.h"
+#include "Precomputed.h"
 #include "FormFactorPolyhedron.h"
 
 static const complex_t I(0.,1.);
diff --git a/Core/FormFactors/FormFactorPrism3.cpp b/Core/FormFactors/FormFactorPrism3.cpp
index 8ba45e7331610aaecf7c4277f6c85b242a3321cd..eaa776175f09741de62f1f41cb11d040f2334800 100644
--- a/Core/FormFactors/FormFactorPrism3.cpp
+++ b/Core/FormFactors/FormFactorPrism3.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorPrism3.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorPrism3.h"
 
 //! @brief Prism3 constructor
 //! @param base_edge of hexagonal base
diff --git a/Core/FormFactors/FormFactorPrism6.cpp b/Core/FormFactors/FormFactorPrism6.cpp
index 1ec3c1aa5dfa17824942fbf96a186d184cc626ef..e40e0620b87545243eb606514afdc618dc992a8c 100644
--- a/Core/FormFactors/FormFactorPrism6.cpp
+++ b/Core/FormFactors/FormFactorPrism6.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorPrism6.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorPrism6.h"
 
 //! @brief Prism6 constructor
 //! @param base_edge of hexagonal base
diff --git a/Core/FormFactors/FormFactorPyramid.cpp b/Core/FormFactors/FormFactorPyramid.cpp
index 219420482173356eb88c231f9dc8a288786da2c4..9558c3121dde4eda2c8377774082507b5ec201db 100644
--- a/Core/FormFactors/FormFactorPyramid.cpp
+++ b/Core/FormFactors/FormFactorPyramid.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorPyramid.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorPyramid.h"
 
 const PolyhedralTopology FormFactorPyramid::topology = {
     {
diff --git a/Core/FormFactors/FormFactorRipple2.cpp b/Core/FormFactors/FormFactorRipple2.cpp
index 76678c7ea8cbf21432f88c366a72cbf06816a3b1..76daf77ff62f4d3c3d171761e9f346bfdd6966f7 100644
--- a/Core/FormFactors/FormFactorRipple2.cpp
+++ b/Core/FormFactors/FormFactorRipple2.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorRipple2.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
+#include "FormFactorRipple2.h"
 
 
 using namespace  BornAgain;
diff --git a/Core/FormFactors/FormFactorSphereGaussianRadius.cpp b/Core/FormFactors/FormFactorSphereGaussianRadius.cpp
index 4e815929efa8530afbf08d06258758e6015cc62b..2e4cd68ebdacbb770d386ac1fb4921f528412182 100644
--- a/Core/FormFactors/FormFactorSphereGaussianRadius.cpp
+++ b/Core/FormFactors/FormFactorSphereGaussianRadius.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorSphereGaussianRadius.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorSphereGaussianRadius.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorSphereLogNormalRadius.cpp b/Core/FormFactors/FormFactorSphereLogNormalRadius.cpp
index 40027c88c89796d9abc3c63007a969d8cba35d96..240b7bf0775708176892b6ebdbce1cbbd5eaa474 100644
--- a/Core/FormFactors/FormFactorSphereLogNormalRadius.cpp
+++ b/Core/FormFactors/FormFactorSphereLogNormalRadius.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorSphereLogNormalRadius.h"
 #include "BornAgainNamespace.h"
 #include "Distributions.h"
+#include "FormFactorSphereLogNormalRadius.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorSphereLogNormalRadius.h b/Core/FormFactors/FormFactorSphereLogNormalRadius.h
index 10271a5418c924184fa5428309dcdc184d701aa6..386eec06e409804b8905a3e7479f87deca2cf28f 100644
--- a/Core/FormFactors/FormFactorSphereLogNormalRadius.h
+++ b/Core/FormFactors/FormFactorSphereLogNormalRadius.h
@@ -15,8 +15,8 @@
 
 #ifndef FORMFACTORSPHERELOGNORMALRADIUS_H
 #define FORMFACTORSPHERELOGNORMALRADIUS_H
-#include "SafePointerVector.h"
 #include "FormFactorFullSphere.h"
+#include "SafePointerVector.h"
 
 class DistributionLogNormal;
 
diff --git a/Core/FormFactors/FormFactorSphereUniformRadius.cpp b/Core/FormFactors/FormFactorSphereUniformRadius.cpp
index afdb8e3a5dbc5f5350a03c04a5d92f29579842f4..c79d7156390815fe6dc8b440090f83ec01a1eab3 100644
--- a/Core/FormFactors/FormFactorSphereUniformRadius.cpp
+++ b/Core/FormFactors/FormFactorSphereUniformRadius.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorSphereUniformRadius.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorSphereUniformRadius.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorTetrahedron.cpp b/Core/FormFactors/FormFactorTetrahedron.cpp
index 44480173cdb1641bc2b9c6196519c81b5655d9c2..f1fb788131ec97369a94c51de5344047b5b049f2 100644
--- a/Core/FormFactors/FormFactorTetrahedron.cpp
+++ b/Core/FormFactors/FormFactorTetrahedron.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorTetrahedron.h"
-#include "MathFunctions.h"
 #include "BornAgainNamespace.h"
+#include "MathFunctions.h"
+#include "FormFactorTetrahedron.h"
 
 const PolyhedralTopology FormFactorTetrahedron::topology = {
     {
diff --git a/Core/FormFactors/FormFactorTools.cpp b/Core/FormFactors/FormFactorTools.cpp
index 9a1b4257600a737ef1284492fb3818a394751718..bbbac140dbecd2edd5a344918bf1d2f164c3aefa 100644
--- a/Core/FormFactors/FormFactorTools.cpp
+++ b/Core/FormFactors/FormFactorTools.cpp
@@ -13,9 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorTools.h"
 #include "FormFactorDWBA.h"
 #include "FormFactorDWBAPol.h"
+#include "FormFactorTools.h"
 
 IFormFactor *FormFactorTools::createDWBAScalarFormFactor(const IFormFactor &form_factor)
 {
diff --git a/Core/FormFactors/FormFactorTriangle.cpp b/Core/FormFactors/FormFactorTriangle.cpp
index b8460b7fe1a0d83191f828c0ba2bb74760e5e006..1795b5f8b901e6bdf17cf3c7a0a950cc85b360af 100644
--- a/Core/FormFactors/FormFactorTriangle.cpp
+++ b/Core/FormFactors/FormFactorTriangle.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorTriangle.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorTriangle.h"
 
 FormFactorTriangle::FormFactorTriangle(const double base_edge)
     : m_base_edge( base_edge )
diff --git a/Core/FormFactors/FormFactorTrivial.cpp b/Core/FormFactors/FormFactorTrivial.cpp
index 94d5f8bad2667121626f7f7a00bc49dec10d3be3..729957e6081452cc422d89066eb08882cf2e7242 100644
--- a/Core/FormFactors/FormFactorTrivial.cpp
+++ b/Core/FormFactors/FormFactorTrivial.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorTrivial.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorTrivial.h"
 
 
 FormFactorTrivial::FormFactorTrivial()
diff --git a/Core/FormFactors/FormFactorTruncatedCube.cpp b/Core/FormFactors/FormFactorTruncatedCube.cpp
index af8ff909d4509ffd20f40b6bfeeedbbc82e51141..cbf216f585873bbf469439f13d04507ca18b6a0b 100644
--- a/Core/FormFactors/FormFactorTruncatedCube.cpp
+++ b/Core/FormFactors/FormFactorTruncatedCube.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorTruncatedCube.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorTruncatedCube.h"
 
 const PolyhedralTopology FormFactorTruncatedCube::topology = {
     {
diff --git a/Core/FormFactors/FormFactorTruncatedSphere.cpp b/Core/FormFactors/FormFactorTruncatedSphere.cpp
index 42b51e96cfe4852089e07925df6800d0c842a3fc..adccfb1de0c69d14832e7d77381d79dd8ae1f1d9 100644
--- a/Core/FormFactors/FormFactorTruncatedSphere.cpp
+++ b/Core/FormFactors/FormFactorTruncatedSphere.cpp
@@ -13,11 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorTruncatedSphere.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
-#include "IntegratorComplex.h"
-
+#include "FormFactorTruncatedSphere.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorTruncatedSphere.h b/Core/FormFactors/FormFactorTruncatedSphere.h
index 2ece31eb08174a2cd31319064d8bf3c2fb346d3e..2577bd59658c08715774f092ec76374113acd34e 100644
--- a/Core/FormFactors/FormFactorTruncatedSphere.h
+++ b/Core/FormFactors/FormFactorTruncatedSphere.h
@@ -18,9 +18,7 @@
 
 #include <memory>
 #include "IFormFactorBorn.h"
-
-// Forward declaration to prevent IntegratorComplex.h to be parsed for Python API:
-template <class T> class IntegratorComplex;
+#include "IntegratorComplex.h"
 
 //! @class FormFactorTruncatedSphere
 //! @ingroup formfactors
diff --git a/Core/FormFactors/FormFactorTruncatedSpheroid.cpp b/Core/FormFactors/FormFactorTruncatedSpheroid.cpp
index 718723a7030ac87aba8046bfe960058dd779ce74..b05971195ee4a1c598e5212eacb03a1278983f54 100644
--- a/Core/FormFactors/FormFactorTruncatedSpheroid.cpp
+++ b/Core/FormFactors/FormFactorTruncatedSpheroid.cpp
@@ -13,10 +13,9 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorTruncatedSpheroid.h"
 #include "BornAgainNamespace.h"
 #include "MathFunctions.h"
-#include "IntegratorComplex.h"
+#include "FormFactorTruncatedSpheroid.h"
 
 using namespace  BornAgain;
 
diff --git a/Core/FormFactors/FormFactorTruncatedSpheroid.h b/Core/FormFactors/FormFactorTruncatedSpheroid.h
index 691ac031ca41bd32b7eddad9f05c17df984c039d..2bb3e2427dd88c14f48e7f6d1517859f6ee3b142 100644
--- a/Core/FormFactors/FormFactorTruncatedSpheroid.h
+++ b/Core/FormFactors/FormFactorTruncatedSpheroid.h
@@ -18,9 +18,7 @@
 
 #include <memory>
 #include "IFormFactorBorn.h"
-
-// Forward declaration to prevent IntegratorComplex.h to be parsed for Python API:
-template <class T> class IntegratorComplex;
+#include "IntegratorComplex.h"
 
 //! @class FormFactorTruncatedSpheroid
 //! @ingroup formfactors
@@ -33,9 +31,9 @@ public:
 
     virtual ~FormFactorTruncatedSpheroid();
 
-    virtual FormFactorTruncatedSpheroid *clone() const;
+    virtual FormFactorTruncatedSpheroid* clone() const;
 
-    virtual void accept(ISampleVisitor *visitor) const;
+    virtual void accept(ISampleVisitor* visitor) const;
 
     double getHeight() const;
 
diff --git a/Core/FormFactors/FormFactorWeighted.cpp b/Core/FormFactors/FormFactorWeighted.cpp
index b79294f79f651e092a9f4b94d9e21f1ebb9db97c..96f0b3e5279eaf7847207660c81d62fd2a86954d 100644
--- a/Core/FormFactors/FormFactorWeighted.cpp
+++ b/Core/FormFactors/FormFactorWeighted.cpp
@@ -13,8 +13,8 @@
 //
 // ************************************************************************** //
 
-#include "FormFactorWeighted.h"
 #include "BornAgainNamespace.h"
+#include "FormFactorWeighted.h"
 
 
 FormFactorWeighted::FormFactorWeighted()
diff --git a/Core/FormFactors/IFormFactor.h b/Core/FormFactors/IFormFactor.h
index fc7b16caca1ccba009a266928bbb7b460b661a1d..dee1fb68b07055f61a740708a7ba23a4cba6315b 100644
--- a/Core/FormFactors/IFormFactor.h
+++ b/Core/FormFactors/IFormFactor.h
@@ -17,8 +17,8 @@
 #define IFORMFACTOR_H
 
 #include "Complex.h"
-#include "ISample.h"
 #include "EigenCore.h"
+#include "ISample.h"
 #include "WavevectorInfo.h"
 
 class ILayerRTCoefficients;
diff --git a/Core/FormFactors/WavevectorInfo.h b/Core/FormFactors/WavevectorInfo.h
index 3754354a0629cfb1998d84e91b20907df77affc3..4810b446433d0e4063e2e2d5ac8961915dee9c70 100644
--- a/Core/FormFactors/WavevectorInfo.h
+++ b/Core/FormFactors/WavevectorInfo.h
@@ -16,8 +16,8 @@
 #ifndef WAVEVECTORINFO_H
 #define WAVEVECTORINFO_H
 
-#include "Units.h"
 #include "Bin.h"
+#include "Units.h"
 
 
 //! @class WavevectorInfo