diff --git a/GUI/Model/Descriptor/AxisProperty.cpp b/GUI/Model/Descriptor/AxisProperty.cpp
index aef84f281b7ba67c4ffd943fa3580868405db469..41819068484a6ed1727c73fec8d59b41ba66d180 100644
--- a/GUI/Model/Descriptor/AxisProperty.cpp
+++ b/GUI/Model/Descriptor/AxisProperty.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Base/Util/Assert.h"
 #include "GUI/Model/Descriptor/AxisProperty.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -23,8 +23,8 @@ const QString Nbins("Nbins");
 const QString Min("Min");
 const QString Max("Max");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 using std::variant;
 
@@ -51,7 +51,7 @@ std::unique_ptr<FixedBinAxis> AxisProperty::createAxis(double scaleFactor) const
 }
 
 void AxisProperty::rwAxisProperty(Streamer& s, const QString& tag)
-{    
+{
     s.start(tag);
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::Nbins, m_nbins);
diff --git a/GUI/Model/Descriptor/DistributionItems.cpp b/GUI/Model/Descriptor/DistributionItems.cpp
index f3ce1ab929cd5e6d2ae532c25245800dbf83cbad..686b879f7ee66cf44f9784048cc0f0bd7f520439 100644
--- a/GUI/Model/Descriptor/DistributionItems.cpp
+++ b/GUI/Model/Descriptor/DistributionItems.cpp
@@ -37,8 +37,8 @@ const QString LeftWidth("LeftWidth");
 const QString MiddleWidth("MiddleWidth");
 const QString RightWidth("RightWidth");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 using std::variant;
 
@@ -63,7 +63,9 @@ void DistributionItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::NumberOfSamples, m_numberOfSamples);
-    Serialize::rwProperty(s, Tag::SigmaFactor, m_sigmaFactor);
+
+    if (hasSigmaFactor())
+        Serialize::rwProperty(s, Tag::SigmaFactor, m_sigmaFactor);
 
     // m_limits and a changed unit (with setUnit) will not be serialized here. They have to be set
     // again by the owner of DistributionItem after reading it
@@ -93,7 +95,7 @@ void SymmetricResolutionItem::setMeanDecimals(uint d)
     m_mean.setDecimals(d);
 }
 
-void SymmetricResolutionItem::serialize(Streamer &s)
+void SymmetricResolutionItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Mean, m_mean);
@@ -165,7 +167,7 @@ void DistributionGateItem::setRange(double min, double max)
     m_maximum.set(max);
 }
 
-void DistributionGateItem::serialize(Streamer &s)
+void DistributionGateItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Minimum, m_minimum);
@@ -221,7 +223,7 @@ void DistributionLorentzItem::initDistribution(double value)
     m_hwhm.setLimits(RealLimits::lowerLimited(0.0));
 }
 
-void DistributionLorentzItem::serialize(Streamer &s)
+void DistributionLorentzItem::serialize(Streamer& s)
 {
     SymmetricResolutionItem::serialize(s);
     Serialize::rwProperty(s, Tag::HWHM, m_hwhm);
@@ -277,7 +279,7 @@ void DistributionGaussianItem::initDistribution(double value)
     setStandardDeviation(stddev);
 }
 
-void DistributionGaussianItem::serialize(Streamer &s)
+void DistributionGaussianItem::serialize(Streamer& s)
 {
     SymmetricResolutionItem::serialize(s);
     Serialize::rwProperty(s, Tag::StandardDeviation, m_standardDeviation);
@@ -320,7 +322,7 @@ void DistributionLogNormalItem::initDistribution(double value)
     setScaleParameter(scale);
 }
 
-void DistributionLogNormalItem::serialize(Streamer &s)
+void DistributionLogNormalItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Median, m_median);
@@ -374,7 +376,7 @@ void DistributionCosineItem::initDistribution(double value)
     setSigma(sigma);
 }
 
-void DistributionCosineItem::serialize(Streamer &s)
+void DistributionCosineItem::serialize(Streamer& s)
 {
     SymmetricResolutionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Sigma, m_sigma);
@@ -421,7 +423,7 @@ void DistributionTrapezoidItem::initDistribution(double value)
     setRightWidth(width);
 }
 
-void DistributionTrapezoidItem::serialize(Streamer &s)
+void DistributionTrapezoidItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Center, m_center);
diff --git a/GUI/Model/Descriptor/DoubleProperty.h b/GUI/Model/Descriptor/DoubleProperty.h
index 05d7a8b6d07743c0abf4d0933839d691a4dc18a1..6aab1e51139331154f2b9d8c7ddbc2a2e3eb4481 100644
--- a/GUI/Model/Descriptor/DoubleProperty.h
+++ b/GUI/Model/Descriptor/DoubleProperty.h
@@ -65,7 +65,7 @@ public:
     double get() const { return m_value; }
 
     //! Persistent tag for serializing.
-//    QString persistentTag() const { return m_persistentTag; }
+    //    QString persistentTag() const { return m_persistentTag; }
 
     //! Unique id of this double property.
     QString uid() const { return m_uid; }
@@ -100,7 +100,7 @@ private:
 };
 
 namespace Serialize {
-void rwProperty(Streamer& s, const QString &tag, DoubleProperty& d);
+void rwProperty(Streamer& s, const QString& tag, DoubleProperty& d);
 } // namespace Serialize
 
 // clang-format off
diff --git a/GUI/Model/Device/BackgroundItems.cpp b/GUI/Model/Device/BackgroundItems.cpp
index 7e4fdc148eec7b04da51fbbe0ae8612bef81a28c..342e93687ccb68dd6509176cb3eddd839998ac62 100644
--- a/GUI/Model/Device/BackgroundItems.cpp
+++ b/GUI/Model/Device/BackgroundItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Device/BackgroundItems.h"
+#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sim/Background/ConstantBackground.h"
 #include "Sim/Background/PoissonBackground.h"
@@ -24,7 +24,7 @@ namespace Tag {
 const QString BackgroundValue("BackgroundValue");
 
 }
-}
+} // namespace
 
 ConstantBackgroundItem::ConstantBackgroundItem()
 {
diff --git a/GUI/Model/Device/BeamItems.cpp b/GUI/Model/Device/BeamItems.cpp
index 1c4ee4d80dc22768aedb20c85a4e41ae3d3a85a0..71c9993076de25f85a94133a7257e2daf5bb468b 100644
--- a/GUI/Model/Device/BeamItems.cpp
+++ b/GUI/Model/Device/BeamItems.cpp
@@ -12,12 +12,12 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/BeamItems.h"
 #include "Base/Axis/IAxis.h"
 #include "Base/Const/Units.h"
 #include "Device/Beam/Beam.h"
 #include "GUI/Model/CatDevice/FootprintItemCatalog.h"
 #include "GUI/Model/Device/BeamAngleItems.h"
-#include "GUI/Model/Device/BeamItems.h"
 #include "GUI/Model/Device/BeamWavelengthItem.h"
 #include "GUI/Model/Device/FootprintItems.h"
 #include "GUI/Model/Device/PointwiseAxisItem.h"
@@ -33,7 +33,7 @@ const QString Wavelength("Wavelength");
 const QString AzimuthalAngle("AzimuthalAngle");
 const QString InclinationAngle("InclinationAngle");
 
-}
+} // namespace Tag
 
 // defines wavelength limits according to given maximum q value
 RealLimits getLimits(double max_q)
diff --git a/GUI/Model/Device/FootprintItems.cpp b/GUI/Model/Device/FootprintItems.cpp
index 1249221b824a008addba72bdfcf9054556f61d1e..323b599fdceff9e78178b4ac6c700102637bef42 100644
--- a/GUI/Model/Device/FootprintItems.cpp
+++ b/GUI/Model/Device/FootprintItems.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/FootprintItems.h"
 #include "Device/Beam/FootprintGauss.h"
 #include "Device/Beam/FootprintSquare.h"
-#include "GUI/Model/Device/FootprintItems.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -23,8 +23,8 @@ namespace Tag {
 const QString GaussianFootprint("GaussianFootprint");
 const QString SquareFootprint("SquareFootprint");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 std::unique_ptr<IFootprintFactor> FootprintNoneItem::createFootprint() const
 {
diff --git a/GUI/Model/Device/InstrumentItems.cpp b/GUI/Model/Device/InstrumentItems.cpp
index 737254e2cc78738e6b10cc558f44ab860320baef..49ee4bcf2d43c916b9b29c375cd1e86fabc76633 100644
--- a/GUI/Model/Device/InstrumentItems.cpp
+++ b/GUI/Model/Device/InstrumentItems.cpp
@@ -12,6 +12,7 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/InstrumentItems.h"
 #include "Base/Const/Units.h"
 #include "Base/Pixel/RectangularPixel.h"
 #include "Device/Beam/Beam.h"
@@ -27,7 +28,6 @@
 #include "GUI/Model/Device/BeamWavelengthItem.h"
 #include "GUI/Model/Device/DetectorItems.h"
 #include "GUI/Model/Device/Instrument.h"
-#include "GUI/Model/Device/InstrumentItems.h"
 #include "GUI/Model/Device/PointwiseAxisItem.h"
 #include "GUI/Model/Device/RectangularDetectorItem.h"
 #include "GUI/Model/Device/SphericalDetectorItem.h"
@@ -52,7 +52,7 @@ const QString AnalyzerEfficiency("AnalyzerEfficiency");
 const QString AnalyzerTotalTransmission("AnalyzerTotalTransmission");
 const QString Beam("Beam");
 
-}
+} // namespace Tag
 
 void setBeamDistribution(ParameterDistribution::WhichParameter which,
                          const BeamDistributionItem& item, ISimulation& simulation)
diff --git a/GUI/Model/Device/RectangularDetectorItem.cpp b/GUI/Model/Device/RectangularDetectorItem.cpp
index 2d019de94a6af62b3f94baf16b5c8b13ce53bd17..12fbfcc2baf5bf63d1558831e73f97885cece430 100644
--- a/GUI/Model/Device/RectangularDetectorItem.cpp
+++ b/GUI/Model/Device/RectangularDetectorItem.cpp
@@ -12,10 +12,10 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/RectangularDetectorItem.h"
 #include "Device/Detector/RectangularDetector.h"
 #include "GUI/Model/CatDevice/ResolutionFunctionItemCatalog.h"
 #include "GUI/Model/Device/AxesItems.h"
-#include "GUI/Model/Device/RectangularDetectorItem.h"
 #include "GUI/Model/Device/ResolutionFunctionItems.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "GUI/Support/XML/UtilXML.h"
@@ -36,7 +36,7 @@ const QString u0("u0");
 const QString v0("v0");
 const QString Distance("Distance");
 
-}
+} // namespace Tag
 
 const double default_detector_width = 20.0;
 const double default_detector_height = 20.0;
diff --git a/GUI/Model/Device/ResolutionFunctionItems.cpp b/GUI/Model/Device/ResolutionFunctionItems.cpp
index ca75c6ff65e1698624b209db89e61d0426491723..3741fd4326da2258f3bbafb69deffdbc23e68d2e 100644
--- a/GUI/Model/Device/ResolutionFunctionItems.cpp
+++ b/GUI/Model/Device/ResolutionFunctionItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Device/Resolution/ResolutionFunction2DGaussian.h"
 #include "GUI/Model/Device/ResolutionFunctionItems.h"
+#include "Device/Resolution/ResolutionFunction2DGaussian.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -22,8 +22,8 @@ namespace Tag {
 const QString SigmaX("SigmaX");
 const QString SigmaY("SigmaY");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 std::unique_ptr<IResolutionFunction2D>
 ResolutionFunctionNoneItem::createResolutionFunction(double) const
diff --git a/GUI/Model/Sample/CompoundItem.cpp b/GUI/Model/Sample/CompoundItem.cpp
index a8db6731daa5d5f83724c15e4b903a3ba2f79622..6ff879aad9735e8ad3bebfddcd122f0a5adc772b 100644
--- a/GUI/Model/Sample/CompoundItem.cpp
+++ b/GUI/Model/Sample/CompoundItem.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/CatSample/ItemWithParticlesCatalog.h"
 #include "GUI/Model/CatSample/RotationItemCatalog.h"
-#include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
@@ -31,7 +31,7 @@ namespace Tag {
 const QString Abundance("Abundance");
 const QString Particles("Particles");
 
-}
+} // namespace Tag
 
 const QString abundance_tooltip = "Proportion of this type of particles normalized to the \n"
                                   "total number of particles in the layout";
diff --git a/GUI/Model/Sample/CoreAndShellItem.cpp b/GUI/Model/Sample/CoreAndShellItem.cpp
index 885a13da964e082aa9fa31d35af956c230b77500..e6d038044d2f5d6b792cdaa81444e24a02024661 100644
--- a/GUI/Model/Sample/CoreAndShellItem.cpp
+++ b/GUI/Model/Sample/CoreAndShellItem.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
+#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Sample/MaterialItems.h"
 #include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Support/Type/VariantUtil.h"
@@ -30,7 +30,7 @@ const QString Abundance("Abundance");
 const QString Core("Core");
 const QString Shell("Shell");
 
-}
+} // namespace Tag
 
 const QString abundance_tooltip = "Proportion of this type of particles normalized to the \n"
                                   "total number of particles in the layout";
diff --git a/GUI/Model/Sample/FormFactorItems.cpp b/GUI/Model/Sample/FormFactorItems.cpp
index b616a00901c2162f6eec4267be624be9ee378d4b..450ead50312bdb7ad38de757c1626992fa8a1084 100644
--- a/GUI/Model/Sample/FormFactorItems.cpp
+++ b/GUI/Model/Sample/FormFactorItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Base/Const/Units.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
+#include "Base/Const/Units.h"
 #include "Sample/HardParticle/HardParticles.h"
 
 namespace {
@@ -36,8 +36,8 @@ const QString HeightFlattening("HeightFlattening");
 const QString SliceBottom("SliceBottom");
 const QString SliceTop("SliceTop");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 /* ------------------------------------------------ */
 
@@ -54,7 +54,7 @@ std::unique_ptr<IFormFactor> Pyramid2Item::createFormFactor() const
     return std::make_unique<Pyramid2>(length(), width(), height(), alpha() * Units::deg);
 }
 
-void Pyramid2Item::serialize(Streamer &s)
+void Pyramid2Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -77,7 +77,7 @@ std::unique_ptr<IFormFactor> BarGaussItem::createFormFactor() const
     return std::make_unique<BarGauss>(length(), width(), height());
 }
 
-void BarGaussItem::serialize(Streamer &s)
+void BarGaussItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -99,7 +99,7 @@ std::unique_ptr<IFormFactor> BarLorentzItem::createFormFactor() const
     return std::make_unique<BarLorentz>(length(), width(), height());
 }
 
-void BarLorentzItem::serialize(Streamer &s)
+void BarLorentzItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -121,7 +121,7 @@ std::unique_ptr<IFormFactor> BoxItem::createFormFactor() const
     return std::make_unique<Box>(length(), width(), height());
 }
 
-void BoxItem::serialize(Streamer &s)
+void BoxItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -144,7 +144,7 @@ std::unique_ptr<IFormFactor> ConeItem::createFormFactor() const
     return std::make_unique<Cone>(radius(), height(), alpha() * Units::deg);
 }
 
-void ConeItem::serialize(Streamer &s)
+void ConeItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -167,7 +167,7 @@ std::unique_ptr<IFormFactor> Pyramid6Item::createFormFactor() const
     return std::make_unique<Pyramid6>(baseEdge(), height(), alpha() * Units::deg);
 }
 
-void Pyramid6Item::serialize(Streamer &s)
+void Pyramid6Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -195,7 +195,7 @@ std::unique_ptr<IFormFactor> Bipyramid4Item::createFormFactor() const
     return std::make_unique<Bipyramid4>(length(), height(), heightRatio(), alpha() * Units::deg);
 }
 
-void Bipyramid4Item::serialize(Streamer &s)
+void Bipyramid4Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -217,7 +217,7 @@ std::unique_ptr<IFormFactor> CylinderItem::createFormFactor() const
     return std::make_unique<Cylinder>(radius(), height());
 }
 
-void CylinderItem::serialize(Streamer &s)
+void CylinderItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -236,7 +236,7 @@ std::unique_ptr<IFormFactor> DodecahedronItem::createFormFactor() const
     return std::make_unique<Dodecahedron>(edge());
 }
 
-void DodecahedronItem::serialize(Streamer &s)
+void DodecahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
@@ -258,7 +258,7 @@ std::unique_ptr<IFormFactor> EllipsoidalCylinderItem::createFormFactor() const
     return std::make_unique<EllipsoidalCylinder>(radiusX(), radiusY(), height());
 }
 
-void EllipsoidalCylinderItem::serialize(Streamer &s)
+void EllipsoidalCylinderItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::RadiusX, m_radiusX);
@@ -278,7 +278,7 @@ std::unique_ptr<IFormFactor> SphereItem::createFormFactor() const
     return std::make_unique<Sphere>(radius());
 }
 
-void SphereItem::serialize(Streamer &s)
+void SphereItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -297,7 +297,7 @@ std::unique_ptr<IFormFactor> SpheroidItem::createFormFactor() const
     return std::make_unique<Spheroid>(radius(), height());
 }
 
-void SpheroidItem::serialize(Streamer &s)
+void SpheroidItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -320,7 +320,7 @@ std::unique_ptr<IFormFactor> HemiEllipsoidItem::createFormFactor() const
     return std::make_unique<HemiEllipsoid>(radiusX(), radiusY(), height());
 }
 
-void HemiEllipsoidItem::serialize(Streamer &s)
+void HemiEllipsoidItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::RadiusX, m_radiusX);
@@ -340,7 +340,7 @@ std::unique_ptr<IFormFactor> IcosahedronItem::createFormFactor() const
     return std::make_unique<Icosahedron>(edge());
 }
 
-void IcosahedronItem::serialize(Streamer &s)
+void IcosahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
@@ -359,7 +359,7 @@ std::unique_ptr<IFormFactor> Prism3Item::createFormFactor() const
     return std::make_unique<Prism3>(baseEdge(), height());
 }
 
-void Prism3Item::serialize(Streamer &s)
+void Prism3Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -379,7 +379,7 @@ std::unique_ptr<IFormFactor> Prism6Item::createFormFactor() const
     return std::make_unique<Prism6>(baseEdge(), height());
 }
 
-void Prism6Item::serialize(Streamer &s)
+void Prism6Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -401,7 +401,7 @@ std::unique_ptr<IFormFactor> Pyramid4Item::createFormFactor() const
     return std::make_unique<Pyramid4>(baseEdge(), height(), alpha() * Units::deg);
 }
 
-void Pyramid4Item::serialize(Streamer &s)
+void Pyramid4Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -423,7 +423,7 @@ std::unique_ptr<IFormFactor> CosineRippleBoxItem::createFormFactor() const
     return std::make_unique<CosineRippleBox>(length(), width(), height());
 }
 
-void CosineRippleBoxItem::serialize(Streamer &s)
+void CosineRippleBoxItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -445,7 +445,7 @@ std::unique_ptr<IFormFactor> CosineRippleGaussItem::createFormFactor() const
     return std::make_unique<CosineRippleGauss>(length(), width(), height());
 }
 
-void CosineRippleGaussItem::serialize(Streamer &s)
+void CosineRippleGaussItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -467,7 +467,7 @@ std::unique_ptr<IFormFactor> CosineRippleLorentzItem::createFormFactor() const
     return std::make_unique<CosineRippleLorentz>(length(), width(), height());
 }
 
-void CosineRippleLorentzItem::serialize(Streamer &s)
+void CosineRippleLorentzItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -491,7 +491,7 @@ std::unique_ptr<IFormFactor> SawtoothRippleBoxItem::createFormFactor() const
     return std::make_unique<SawtoothRippleBox>(length(), width(), height(), asymmetry());
 }
 
-void SawtoothRippleBoxItem::serialize(Streamer &s)
+void SawtoothRippleBoxItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -516,7 +516,7 @@ std::unique_ptr<IFormFactor> SawtoothRippleGaussItem::createFormFactor() const
     return std::make_unique<SawtoothRippleGauss>(length(), width(), height(), asymmetry());
 }
 
-void SawtoothRippleGaussItem::serialize(Streamer &s)
+void SawtoothRippleGaussItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -541,7 +541,7 @@ std::unique_ptr<IFormFactor> SawtoothRippleLorentzItem::createFormFactor() const
     return std::make_unique<SawtoothRippleLorentz>(length(), width(), height(), asymmetry());
 }
 
-void SawtoothRippleLorentzItem::serialize(Streamer &s)
+void SawtoothRippleLorentzItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -565,7 +565,7 @@ std::unique_ptr<IFormFactor> Pyramid3Item::createFormFactor() const
     return std::make_unique<Pyramid3>(baseEdge(), height(), alpha() * Units::deg);
 }
 
-void Pyramid3Item::serialize(Streamer &s)
+void Pyramid3Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -587,7 +587,7 @@ std::unique_ptr<IFormFactor> TruncatedCubeItem::createFormFactor() const
     return std::make_unique<TruncatedCube>(length(), removedLength());
 }
 
-void TruncatedCubeItem::serialize(Streamer &s)
+void TruncatedCubeItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -609,7 +609,7 @@ std::unique_ptr<IFormFactor> TruncatedSphereItem::createFormFactor() const
     return std::make_unique<TruncatedSphere>(radius(), height(), removedTop());
 }
 
-void TruncatedSphereItem::serialize(Streamer &s)
+void TruncatedSphereItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -638,7 +638,7 @@ std::unique_ptr<IFormFactor> TruncatedSpheroidItem::createFormFactor() const
                                                removedTop());
 }
 
-void TruncatedSpheroidItem::serialize(Streamer &s)
+void TruncatedSpheroidItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -661,7 +661,7 @@ std::unique_ptr<IFormFactor> CantellatedCubeItem::createFormFactor() const
     return std::make_unique<CantellatedCube>(length(), removedLength());
 }
 
-void CantellatedCubeItem::serialize(Streamer &s)
+void CantellatedCubeItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -685,7 +685,7 @@ std::unique_ptr<IFormFactor> HorizontalCylinderItem::createFormFactor() const
     return std::make_unique<HorizontalCylinder>(radius(), length(), sliceBottom(), sliceTop());
 }
 
-void HorizontalCylinderItem::serialize(Streamer &s)
+void HorizontalCylinderItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -706,7 +706,7 @@ std::unique_ptr<IFormFactor> PlatonicOctahedronItem::createFormFactor() const
     return std::make_unique<PlatonicOctahedron>(edge());
 }
 
-void PlatonicOctahedronItem::serialize(Streamer &s)
+void PlatonicOctahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
@@ -724,9 +724,8 @@ std::unique_ptr<IFormFactor> PlatonicTetrahedronItem::createFormFactor() const
     return std::make_unique<PlatonicTetrahedron>(edge());
 }
 
-void PlatonicTetrahedronItem::serialize(Streamer &s)
+void PlatonicTetrahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
 }
-
diff --git a/GUI/Model/Sample/InterferenceItems.cpp b/GUI/Model/Sample/InterferenceItems.cpp
index 5b4bbd11140171b41bc0bb79d167ef3c7c9d595e..a8ed565c14b811213bf20f174873b6b63fc92915 100644
--- a/GUI/Model/Sample/InterferenceItems.cpp
+++ b/GUI/Model/Sample/InterferenceItems.cpp
@@ -12,10 +12,10 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/InterferenceItems.h"
 #include "Base/Const/Units.h"
 #include "GUI/Model/CatSample/Lattice2DItemCatalog.h"
 #include "GUI/Model/CatSample/ProfileItemCatalogs.h"
-#include "GUI/Model/Sample/InterferenceItems.h"
 #include "GUI/Model/Sample/Lattice2DItems.h"
 #include "GUI/Model/Sample/ProfileItems.h"
 #include "GUI/Support/XML/Serialize.h"
@@ -37,8 +37,8 @@ const QString Density("Density");
 const QString PeakDistance("PeakDistance");
 const QString Kappa("Kappa");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 InterferenceItem::InterferenceItem()
 {
diff --git a/GUI/Model/Sample/Lattice2DItems.cpp b/GUI/Model/Sample/Lattice2DItems.cpp
index f4c8af9be6415a871a02fe501a66d7ca86a61e25..74884987989db40b28764b379908da734e912b76 100644
--- a/GUI/Model/Sample/Lattice2DItems.cpp
+++ b/GUI/Model/Sample/Lattice2DItems.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/Lattice2DItems.h"
 #include "Base/Const/Units.h"
 #include "Base/Util/Assert.h"
-#include "GUI/Model/Sample/Lattice2DItems.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sample/Lattice/Lattice2D.h"
 
@@ -27,8 +27,8 @@ const QString Length1("Length1");
 const QString Length2("Length2");
 const QString Angle("Angle");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 Lattice2DItem::Lattice2DItem()
 {
diff --git a/GUI/Model/Sample/LayerItem.cpp b/GUI/Model/Sample/LayerItem.cpp
index 903d1587bb778826e889b9595e132c7e5b5650d5..5d3085f8b9adbf6501329e0b1d83025d708e081e 100644
--- a/GUI/Model/Sample/LayerItem.cpp
+++ b/GUI/Model/Sample/LayerItem.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
-#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/MultiLayerItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
@@ -33,7 +33,7 @@ const QString Thickness("Thickness");
 const QString Roughness("Roughness");
 const QString Layouts("Layouts");
 
-}
+} // namespace Tag
 
 QVector<ItemWithMaterial*> layoutItemsWithMaterial(ParticleLayoutItem* layout)
 {
@@ -142,7 +142,7 @@ void LayerItem::removeLayout(ParticleLayoutItem* layout)
 }
 
 void LayerItem::serialize(Streamer& s)
-{   
+{
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::Name, m_name);
     Serialize::rwValue(s, Tag::Color, m_color);
diff --git a/GUI/Model/Sample/LayerRoughnessItems.cpp b/GUI/Model/Sample/LayerRoughnessItems.cpp
index 7796dc43dd6ebad77f1d393aa3b9fa5c57d75d32..594914403055696de77204b18afe3e60d47cb0b5 100644
--- a/GUI/Model/Sample/LayerRoughnessItems.cpp
+++ b/GUI/Model/Sample/LayerRoughnessItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Sample/LayerRoughnessItems.h"
+#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -23,8 +23,8 @@ const QString Sigma("Sigma");
 const QString Hurst("Hurst");
 const QString LateralCorrelationLength("LateralCorrelationLength");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 LayerBasicRoughnessItem::LayerBasicRoughnessItem()
 {
diff --git a/GUI/Model/Sample/MesocrystalItem.cpp b/GUI/Model/Sample/MesocrystalItem.cpp
index a8b302b7571ca94b54c01eb4c8c2a19b95c52e58..a5bf7b609faff41b61777172b1d3920e809d4620 100644
--- a/GUI/Model/Sample/MesocrystalItem.cpp
+++ b/GUI/Model/Sample/MesocrystalItem.cpp
@@ -12,13 +12,13 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/CatSample/FormFactorItemCatalog.h"
 #include "GUI/Model/CatSample/ItemWithParticlesCatalog.h"
 #include "GUI/Model/CatSample/RotationItemCatalog.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
-#include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "GUI/Util/Error.h"
diff --git a/GUI/Model/Sample/MultiLayerItem.cpp b/GUI/Model/Sample/MultiLayerItem.cpp
index a3c764f675d58a6ff6ddb59b456aebf4ec197468..d6a6bbc2c56ee013649fd61ad93c0dd832895cf2 100644
--- a/GUI/Model/Sample/MultiLayerItem.cpp
+++ b/GUI/Model/Sample/MultiLayerItem.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/MultiLayerItem.h"
+#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Support/XML/Backup.h"
 #include "GUI/Support/XML/Serialize.h"
 #include <QXmlStreamWriter>
@@ -27,8 +27,8 @@ const QString CrossCorrelationLength("CrossCorrelationLength");
 const QString Materials("Materials");
 const QString Layers("Layers");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 MultiLayerItem::MultiLayerItem()
 {
@@ -154,7 +154,7 @@ void MultiLayerItem::readContentFrom(QXmlStreamReader* reader)
 }
 
 void MultiLayerItem::serialize(Streamer& s)
-{    
+{
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::Name, m_name);
     Serialize::rwValue(s, Tag::Description, m_description);
diff --git a/GUI/Model/Sample/ParticleItem.cpp b/GUI/Model/Sample/ParticleItem.cpp
index c5ed7dc525efaddcb6c81b84f52576fda557c912..c65c08ce34f561672e47a89e3e29d169f1d2025b 100644
--- a/GUI/Model/Sample/ParticleItem.cpp
+++ b/GUI/Model/Sample/ParticleItem.cpp
@@ -12,12 +12,12 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Model/CatSample/FormFactorItemCatalog.h"
 #include "GUI/Model/CatSample/RotationItemCatalog.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
 #include "GUI/Model/Sample/MaterialItem.h"
-#include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sample/Particle/IFormFactor.h"
 #include "Sample/Particle/Particle.h"
diff --git a/GUI/Model/Sample/ParticleLayoutItem.cpp b/GUI/Model/Sample/ParticleLayoutItem.cpp
index 117cb44db5193df17605664543d3e9e9e1bc5313..edef14c9b149a18fdc090ff636f47a4d91d4c6b1 100644
--- a/GUI/Model/Sample/ParticleLayoutItem.cpp
+++ b/GUI/Model/Sample/ParticleLayoutItem.cpp
@@ -12,6 +12,7 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/ParticleLayoutItem.h"
 #include "GUI/Model/CatSample/InterferenceItemCatalog.h"
 #include "GUI/Model/CatSample/ItemWithParticlesCatalog.h"
 #include "GUI/Model/Sample/CompoundItem.h"
@@ -19,7 +20,6 @@
 #include "GUI/Model/Sample/Lattice2DItems.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
-#include "GUI/Model/Sample/ParticleLayoutItem.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -28,8 +28,8 @@ namespace Tag {
 const QString OwnDensity("OwnDensity");
 const QString Particles("Particles");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 ParticleLayoutItem::ParticleLayoutItem(const MaterialItems* materials)
     : m_materials(materials)
diff --git a/GUI/Model/Sample/ProfileItems.cpp b/GUI/Model/Sample/ProfileItems.cpp
index e5687f98566b7b5806f1be4adfd291040a257aaf..d225196ad437d0a999f27cfe34c677b4fbd26edb 100644
--- a/GUI/Model/Sample/ProfileItems.cpp
+++ b/GUI/Model/Sample/ProfileItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Base/Const/Units.h"
 #include "GUI/Model/Sample/ProfileItems.h"
+#include "Base/Const/Units.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -25,8 +25,8 @@ const QString OmegaY("OmegaY");
 const QString Eta("Eta");
 const QString Gamma("Gamma");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 Profile1DItem::Profile1DItem()
 {
diff --git a/GUI/Model/Sample/RotationItems.cpp b/GUI/Model/Sample/RotationItems.cpp
index ff31f527f0298c510873daef12fdc7e37c8d6d50..6ed7f274af206d4e4a9376d892149bf529448a91 100644
--- a/GUI/Model/Sample/RotationItems.cpp
+++ b/GUI/Model/Sample/RotationItems.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/RotationItems.h"
 #include "Base/Const/Units.h"
 #include "Base/Vector/RotMatrix.h"
-#include "GUI/Model/Sample/RotationItems.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sample/Scattering/Rotations.h"
 
@@ -26,8 +26,8 @@ const QString Alpha("Alpha");
 const QString Beta("Beta");
 const QString Gamma("Gamma");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 using namespace Units;