diff --git a/Core/Simulation/ISimulation2D.cpp b/Core/Simulation/ISimulation2D.cpp
index e116ff5123d5ff3ece2f1403266f26736ae0feb3..edc6840a1c0bbae33dfbe4e0d3053256faa3ba3c 100644
--- a/Core/Simulation/ISimulation2D.cpp
+++ b/Core/Simulation/ISimulation2D.cpp
@@ -28,10 +28,6 @@ void ISimulation2D::prepareSimulation() {
     m_detector_context = instrument().detector2D().createContext();
 }
 
-void ISimulation2D::removeMasks() {
-    instrument().detector2D().removeMasks();
-}
-
 void ISimulation2D::addMask(const IShape2D& shape, bool mask_value) {
     instrument().detector2D().addMask(shape, mask_value);
 }
diff --git a/Core/Simulation/ISimulation2D.h b/Core/Simulation/ISimulation2D.h
index a410a786f6c35856d4a66610a00d6b7f6def487d..dabfbec1d791833d6d21fc1f57f9f9e28695785a 100644
--- a/Core/Simulation/ISimulation2D.h
+++ b/Core/Simulation/ISimulation2D.h
@@ -46,9 +46,6 @@ public:
     //! Sets the detector (axes can be overwritten later)
     void setDetector(const IDetector2D& detector);
 
-    //! removes all masks from the detector
-    void removeMasks();
-
     //! Adds mask of given shape to the stack of detector masks. The mask value 'true' means
     //! that the channel will be excluded from the simulation. The mask which is added last
     //! has priority.
diff --git a/Device/Detector/DetectorMask.cpp b/Device/Detector/DetectorMask.cpp
index 61a56b618b6298f55c06351ab2e5881001bb5337..2735302d507c729046282a65949a26f53c39f336 100644
--- a/Device/Detector/DetectorMask.cpp
+++ b/Device/Detector/DetectorMask.cpp
@@ -82,12 +82,6 @@ Histogram2D* DetectorMask::createHistogram() const {
     return dynamic_cast<Histogram2D*>(IHistogram::createHistogram(data));
 }
 
-void DetectorMask::removeMasks() {
-    m_shapes.clear();
-    m_mask_of_shape.clear();
-    m_mask_data.clear();
-}
-
 size_t DetectorMask::numberOfMasks() const {
     return m_shapes.size();
 }
diff --git a/Device/Detector/DetectorMask.h b/Device/Detector/DetectorMask.h
index 58743f70213792964f8c8289bd6338ed3f99e406..cf2b69468ae733931f0207e0b64db645087e1a47 100644
--- a/Device/Detector/DetectorMask.h
+++ b/Device/Detector/DetectorMask.h
@@ -48,9 +48,6 @@ public:
 
     Histogram2D* createHistogram() const;
 
-    //! remove all masks and return object to initial state
-    void removeMasks();
-
     //! returns true if has masks
     bool hasMasks() const { return !m_shapes.empty(); }
 
diff --git a/Device/Detector/IDetector2D.cpp b/Device/Detector/IDetector2D.cpp
index d56939358b591bb483d0a4d15db68da997405455..5da7895fbfcde7ce7e674fb59d88a9e97e995817 100644
--- a/Device/Detector/IDetector2D.cpp
+++ b/Device/Detector/IDetector2D.cpp
@@ -64,10 +64,6 @@ std::unique_ptr<DetectorContext> IDetector2D::createContext() const {
     return std::make_unique<DetectorContext>(this);
 }
 
-void IDetector2D::removeMasks() {
-    m_detector_mask.removeMasks();
-}
-
 void IDetector2D::addMask(const IShape2D& shape, bool mask_value) {
     m_detector_mask.addMask(shape, mask_value);
     m_detector_mask.initMaskData(*this);
@@ -76,7 +72,6 @@ void IDetector2D::addMask(const IShape2D& shape, bool mask_value) {
 void IDetector2D::maskAll() {
     if (dimension() != 2)
         return;
-    m_detector_mask.removeMasks();
     addMask(InfinitePlane(), true);
 }
 
diff --git a/Device/Detector/IDetector2D.h b/Device/Detector/IDetector2D.h
index 8bdfc087c625f5a9a02ffea6eada5324597a2e6f..b6863a731de988b359a02191972560cbfdf14ea2 100644
--- a/Device/Detector/IDetector2D.h
+++ b/Device/Detector/IDetector2D.h
@@ -39,9 +39,6 @@ public:
     void setDetectorParameters(size_t n_x, double x_min, double x_max, size_t n_y, double y_min,
                                double y_max);
 
-    //! Removes all masks from the detector
-    void removeMasks();
-
     const DetectorMask* detectorMask() const override;
 
     //! Adds mask of given shape to the stack of detector masks. The mask value 'true' means
diff --git a/Examples/Python/fit52_Advanced/fit_with_masks.py b/Examples/Python/fit52_Advanced/fit_with_masks.py
index 21ddfa0975a495f3eda5588deeecf25dd0362c56..6c00d5a7a6278801a95f1042236a16367704801e 100644
--- a/Examples/Python/fit52_Advanced/fit_with_masks.py
+++ b/Examples/Python/fit52_Advanced/fit_with_masks.py
@@ -107,15 +107,6 @@ def add_mask_to_simulation(simulation):
     simulation.addMask(ba.Rectangle(0.75*deg, 0.95*deg, 0.85*deg, 1.05*deg),
                        False)
 
-    # other mask's shapes are possible too
-    # simulation.removeMasks()
-    # # rotated ellipse:
-    # simulation.addMask(ba.Ellipse(0.11*deg, 1.25*deg,
-    #                    1.0*deg, 0.5*deg, 45.0*deg), True)
-    # simulation.addMask(Line(-1.0*deg, 0.0*deg, 1.0*deg, 2.0*deg), True)
-    # simulation.addMask(ba.HorizontalLine(1.0*deg), False)
-    # simulation.addMask(ba.VerticalLine(0.0*deg), False)
-
 
 def run_fitting():
     """
diff --git a/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp b/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp
index 9579a08d3c0dff2263fabbf29c5e61c732896e05..289064bea75e9d021ed94af3b084f8f21e3faa30 100644
--- a/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp
+++ b/Tests/UnitTests/Core/Detector/DetectorMaskTest.cpp
@@ -79,13 +79,6 @@ TEST_F(DetectorMaskTest, AddMask) {
             EXPECT_FALSE(detectorMask.isMasked(index));
         }
     }
-
-    // clearing all masks
-    detectorMask.removeMasks();
-    detectorMask.initMaskData(detector);
-    for (size_t index = 0; index < detectorMask.getMaskData()->getAllocatedSize(); ++index) {
-        EXPECT_FALSE(detectorMask.isMasked(index));
-    }
 }
 
 TEST_F(DetectorMaskTest, AssignmentOperator) {
diff --git a/auto/Wrap/doxygenCore.i b/auto/Wrap/doxygenCore.i
index 832016732b4fad6c4a811d1c668fef3aee364419..08dfa1d673502c3f1827abd897bc6fcb2f10013b 100644
--- a/auto/Wrap/doxygenCore.i
+++ b/auto/Wrap/doxygenCore.i
@@ -1072,11 +1072,6 @@ upper edge of last alpha-bin
 Sets the detector (axes can be overwritten later) 
 ";
 
-%feature("docstring")  ISimulation2D::removeMasks "void ISimulation2D::removeMasks()
-
-removes all masks from the detector 
-";
-
 %feature("docstring")  ISimulation2D::addMask "void ISimulation2D::addMask(const IShape2D &shape, bool mask_value=true)
 
 Adds mask of given shape to the stack of detector masks. The mask value 'true' means that the channel will be excluded from the simulation. The mask which is added last has priority.
diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i
index 2b2b6f02973c076538ee65fae378c40ad4d63d47..97c1f99b2c1d0c588f6216fc3964214f5684bffb 100644
--- a/auto/Wrap/doxygenDevice.i
+++ b/auto/Wrap/doxygenDevice.i
@@ -394,11 +394,6 @@ Init the map of masks for the given detector plane.
 %feature("docstring")  DetectorMask::createHistogram "Histogram2D * DetectorMask::createHistogram() const
 ";
 
-%feature("docstring")  DetectorMask::removeMasks "void DetectorMask::removeMasks()
-
-remove all masks and return object to initial state 
-";
-
 %feature("docstring")  DetectorMask::hasMasks "bool DetectorMask::hasMasks() const
 
 returns true if has masks 
@@ -1037,11 +1032,6 @@ C++ includes: IDetector2D.h
 Sets detector parameters using angle ranges. 
 ";
 
-%feature("docstring")  IDetector2D::removeMasks "void IDetector2D::removeMasks()
-
-Removes all masks from the detector. 
-";
-
 %feature("docstring")  IDetector2D::detectorMask "const DetectorMask * IDetector2D::detectorMask() const override
 
 Returns detector masks container. 
diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py
index cadae3348509aee582e2833c4189aa0a8eaf3088..dd65788bd76f7a732a176b71cc49f51afd41ea5b 100644
--- a/auto/Wrap/libBornAgainCore.py
+++ b/auto/Wrap/libBornAgainCore.py
@@ -3873,16 +3873,6 @@ class ISimulation2D(ISimulation):
         """
         return _libBornAgainCore.ISimulation2D_setDetector(self, detector)
 
-    def removeMasks(self):
-        r"""
-        removeMasks(ISimulation2D self)
-        void ISimulation2D::removeMasks()
-
-        removes all masks from the detector 
-
-        """
-        return _libBornAgainCore.ISimulation2D_removeMasks(self)
-
     def addMask(self, shape, mask_value=True):
         r"""
         addMask(ISimulation2D self, IShape2D const & shape, bool mask_value=True)
diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp
index cc2f2b4d9a6c37f5eb04115d4b43b52de8a3d05b..bc76649c261fe030d31f3450dda41d620bcb493f 100644
--- a/auto/Wrap/libBornAgainCore_wrap.cpp
+++ b/auto/Wrap/libBornAgainCore_wrap.cpp
@@ -40429,28 +40429,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_ISimulation2D_removeMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  ISimulation2D *arg1 = (ISimulation2D *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ISimulation2D, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation2D_removeMasks" "', argument " "1"" of type '" "ISimulation2D *""'"); 
-  }
-  arg1 = reinterpret_cast< ISimulation2D * >(argp1);
-  (arg1)->removeMasks();
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_ISimulation2D_addMask__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
   PyObject *resultobj = 0;
   ISimulation2D *arg1 = (ISimulation2D *) 0 ;
@@ -43847,13 +43825,6 @@ static PyMethodDef SwigMethods[] = {
 		"Sets the detector (axes can be overwritten later) \n"
 		"\n"
 		""},
-	 { "ISimulation2D_removeMasks", _wrap_ISimulation2D_removeMasks, METH_O, "\n"
-		"ISimulation2D_removeMasks(ISimulation2D self)\n"
-		"void ISimulation2D::removeMasks()\n"
-		"\n"
-		"removes all masks from the detector \n"
-		"\n"
-		""},
 	 { "ISimulation2D_addMask", _wrap_ISimulation2D_addMask, METH_VARARGS, "\n"
 		"ISimulation2D_addMask(ISimulation2D self, IShape2D const & shape, bool mask_value=True)\n"
 		"void ISimulation2D::addMask(const IShape2D &shape, bool mask_value=true)\n"
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index bc51d8965cc52df7a5aed31aa20494a04f4cf286..7adb138871bf7c1ed83705b3f3c62dc687c9efd7 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -4426,16 +4426,6 @@ class DetectorMask(object):
         """
         return _libBornAgainDevice.DetectorMask_createHistogram(self)
 
-    def removeMasks(self):
-        r"""
-        removeMasks(DetectorMask self)
-        void DetectorMask::removeMasks()
-
-        remove all masks and return object to initial state 
-
-        """
-        return _libBornAgainDevice.DetectorMask_removeMasks(self)
-
     def hasMasks(self):
         r"""
         hasMasks(DetectorMask self) -> bool
@@ -4727,16 +4717,6 @@ class IDetector2D(IDetector):
         """
         return _libBornAgainDevice.IDetector2D_setDetectorParameters(self, n_x, x_min, x_max, n_y, y_min, y_max)
 
-    def removeMasks(self):
-        r"""
-        removeMasks(IDetector2D self)
-        void IDetector2D::removeMasks()
-
-        Removes all masks from the detector. 
-
-        """
-        return _libBornAgainDevice.IDetector2D_removeMasks(self)
-
     def detectorMask(self):
         r"""
         detectorMask(IDetector2D self) -> DetectorMask
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index 6ca5d66de5f52c661868ead051dca0d6241755d9..3ef05c727d588b8d2687be56b5567133619fb998 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -37656,28 +37656,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_DetectorMask_removeMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  DetectorMask *arg1 = (DetectorMask *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DetectorMask, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DetectorMask_removeMasks" "', argument " "1"" of type '" "DetectorMask *""'"); 
-  }
-  arg1 = reinterpret_cast< DetectorMask * >(argp1);
-  (arg1)->removeMasks();
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_DetectorMask_hasMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   DetectorMask *arg1 = (DetectorMask *) 0 ;
@@ -38657,28 +38635,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_IDetector2D_removeMasks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  IDetector2D *arg1 = (IDetector2D *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector2D, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector2D_removeMasks" "', argument " "1"" of type '" "IDetector2D *""'"); 
-  }
-  arg1 = reinterpret_cast< IDetector2D * >(argp1);
-  (arg1)->removeMasks();
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_IDetector2D_detectorMask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   IDetector2D *arg1 = (IDetector2D *) 0 ;
@@ -47431,13 +47387,6 @@ static PyMethodDef SwigMethods[] = {
 		"Histogram2D * DetectorMask::createHistogram() const\n"
 		"\n"
 		""},
-	 { "DetectorMask_removeMasks", _wrap_DetectorMask_removeMasks, METH_O, "\n"
-		"DetectorMask_removeMasks(DetectorMask self)\n"
-		"void DetectorMask::removeMasks()\n"
-		"\n"
-		"remove all masks and return object to initial state \n"
-		"\n"
-		""},
 	 { "DetectorMask_hasMasks", _wrap_DetectorMask_hasMasks, METH_O, "\n"
 		"DetectorMask_hasMasks(DetectorMask self) -> bool\n"
 		"bool DetectorMask::hasMasks() const\n"
@@ -47621,13 +47570,6 @@ static PyMethodDef SwigMethods[] = {
 		"Sets detector parameters using angle ranges. \n"
 		"\n"
 		""},
-	 { "IDetector2D_removeMasks", _wrap_IDetector2D_removeMasks, METH_O, "\n"
-		"IDetector2D_removeMasks(IDetector2D self)\n"
-		"void IDetector2D::removeMasks()\n"
-		"\n"
-		"Removes all masks from the detector. \n"
-		"\n"
-		""},
 	 { "IDetector2D_detectorMask", _wrap_IDetector2D_detectorMask, METH_O, "\n"
 		"IDetector2D_detectorMask(IDetector2D self) -> DetectorMask\n"
 		"const DetectorMask * IDetector2D::detectorMask() const override\n"