diff --git a/Base/Types/OwningVector.h b/Base/Types/OwningVector.h
index f72a9c388c24578dc183a78a1fff9e683ccc31fc..199fd73a1023eebba99fd26b83aa227962a205cf 100644
--- a/Base/Types/OwningVector.h
+++ b/Base/Types/OwningVector.h
@@ -19,6 +19,7 @@
 #define BORNAGAIN_BASE_TYPES_OWNINGVECTOR_H
 
 #include "Base/Util/Assert.h"
+#include "Base/Util/Vec.h"
 #include <algorithm>
 #include <cstddef>
 #include <utility>
@@ -59,13 +60,7 @@ public:
     T* const& at(int i) const { return m_v.at(i); }
     T* const& front() const { return m_v.front(); }
     T* const& back() const { return m_v.back(); }
-    int index_of(const T* t) const
-    {
-        for (size_t i = 0; i < m_v.size(); i++)
-            if (m_v[i] == t)
-                return int(i);
-        return -1;
-    }
+    int index_of(const T* t) const { return Vec::indexOfPtr(t, m_v); }
 
     void delete_element(T* e)
     {
diff --git a/GUI/Model/Data/Data2DItem.cpp b/GUI/Model/Data/Data2DItem.cpp
index 2d7803c37b4ef97b68a136b325a5a8c6bd72d2d2..8ab9dba5a337a0db71d7cf83c5bbbb585a0388f7 100644
--- a/GUI/Model/Data/Data2DItem.cpp
+++ b/GUI/Model/Data/Data2DItem.cpp
@@ -23,7 +23,7 @@
 #include "GUI/Model/Axis/BasicAxisItem.h"
 #include "GUI/Model/Mask/MaskItems.h"
 #include "GUI/Model/Mask/MasksQModel.h"
-#include "GUI/Model/Mask/ProjectionsSet.h"
+#include "GUI/Model/Mask/MasksSet.h"
 #include "GUI/Support/Data/ComboProperty.h"
 #include "GUI/Support/Style/QCP_Util.h"
 #include "GUI/Support/XML/UtilXML.h"
@@ -281,7 +281,7 @@ void Data2DItem::writeTo(QXmlStreamWriter* w) const
 
     // masks and projections
     if (m_model) {
-        if (auto* mi = m_model->masksSet()) {
+        if (const auto* mi = m_model->masksSet()) {
             w->writeStartElement(Tag::MaskContainer);
             mi->writeTo(w);
             w->writeEndElement();
@@ -290,7 +290,7 @@ void Data2DItem::writeTo(QXmlStreamWriter* w) const
 
     // projections
     if (m_proj_model) {
-        if (auto* pi = m_proj_model->projnItem()) {
+        if (const auto* pi = m_proj_model->masksSet()) {
             w->writeStartElement(Tag::ProjectionContainer);
             pi->writeTo(w);
             w->writeEndElement();
@@ -333,7 +333,7 @@ void Data2DItem::readFrom(QXmlStreamReader* r)
 
             // projections
         } else if (tag == Tag::ProjectionContainer) {
-            getOrCreateProjectionModel()->projnItem()->readFrom(r);
+            getOrCreateProjectionModel()->masksSet()->readFrom(r);
             XML::gotoEndElementOfTag(r, tag);
 
         } else
@@ -394,20 +394,20 @@ Datafield* Data2DItem::createMaskedField() const
     return result;
 }
 
-ProjectionsSet* Data2DItem::projectionsSet()
+MasksSet* Data2DItem::projectionsSet()
 {
-    return m_proj_model ? m_proj_model->projnItem() : nullptr;
+    return m_proj_model ? m_proj_model->masksSet() : nullptr;
 }
 
-const ProjectionsSet* Data2DItem::projectionsSet() const
+const MasksSet* Data2DItem::projectionsSet() const
 {
-    return m_proj_model ? m_proj_model->projnItem() : nullptr;
+    return m_proj_model ? m_proj_model->masksSet() : nullptr;
 }
 
 MasksQModel* Data2DItem::getOrCreateProjectionModel()
 {
     if (!m_proj_model)
-        m_proj_model = std::make_unique<MasksQModel>(new ProjectionsSet);
+        m_proj_model = std::make_unique<MasksQModel>(new MasksSet);
 
     return m_proj_model.get();
 }
diff --git a/GUI/Model/Data/Data2DItem.h b/GUI/Model/Data/Data2DItem.h
index 13b592779fffd0e6979a9fc1b0a7849a493f2fbb..714b78954daf997769406fb66c412e344b50c7b8 100644
--- a/GUI/Model/Data/Data2DItem.h
+++ b/GUI/Model/Data/Data2DItem.h
@@ -23,7 +23,6 @@ class ComboProperty;
 class LineItem;
 class MasksQModel;
 class MasksSet;
-class ProjectionsSet;
 class QCPColorGradient;
 
 class Data2DItem : public DataItem {
@@ -82,8 +81,8 @@ public:
     MasksQModel* getOrCreateModel();
     Datafield* createMaskedField() const;
 
-    ProjectionsSet* projectionsSet();
-    const ProjectionsSet* projectionsSet() const;
+    MasksSet* projectionsSet();
+    const MasksSet* projectionsSet() const;
     MasksQModel* getOrCreateProjectionModel();
 
     void clearMasks();
diff --git a/GUI/Model/Device/DatafileItem.cpp b/GUI/Model/Device/DatafileItem.cpp
index 6642fdf09312bab20657e0b2e0ccac3259dce462..6f4bea3bfc8b89b89dcdea53791bc6019cab0847 100644
--- a/GUI/Model/Device/DatafileItem.cpp
+++ b/GUI/Model/Device/DatafileItem.cpp
@@ -21,7 +21,6 @@
 #include "GUI/Model/Data/Data1DItem.h"
 #include "GUI/Model/Data/Data2DItem.h"
 #include "GUI/Model/Device/InstrumentItems.h"
-#include "GUI/Model/Mask/ProjectionsSet.h"
 #include "GUI/Support/Util/Path.h"
 #include "GUI/Support/XML/Backup.h"
 #include "GUI/Support/XML/DeserializationException.h"
diff --git a/GUI/Model/Mask/MaskItems.h b/GUI/Model/Mask/MaskItems.h
index 3dde77e55452371629c51a09ea35b043e68876cf..6dc29c2e66ff188fcc91ad0c56768afc317b708d 100644
--- a/GUI/Model/Mask/MaskItems.h
+++ b/GUI/Model/Mask/MaskItems.h
@@ -116,6 +116,8 @@ public:
     void writeTo(QXmlStreamWriter* w) const override;
     void readFrom(QXmlStreamReader* r) override;
 
+    virtual Qt::Orientation orientation() const = 0;
+
 protected:
     DoubleProperty m_pos;
 };
@@ -124,12 +126,14 @@ class VerticalLineItem : public LineItem {
 public:
     VerticalLineItem();
     std::unique_ptr<IShape2D> createShape() const override;
+    Qt::Orientation orientation() const override { return Qt::Vertical; }
 };
 
 class HorizontalLineItem : public LineItem {
 public:
     HorizontalLineItem();
     std::unique_ptr<IShape2D> createShape() const override;
+    Qt::Orientation orientation() const override { return Qt::Horizontal; }
 };
 
 class EllipseItem : public MaskItem {
diff --git a/GUI/Model/Mask/MasksQModel.cpp b/GUI/Model/Mask/MasksQModel.cpp
index 1a6c4ccbebd2b982ead3abdae48f1527c6a1ba03..d0cb9c091ea643592e458144ee56523417f21f29 100644
--- a/GUI/Model/Mask/MasksQModel.cpp
+++ b/GUI/Model/Mask/MasksQModel.cpp
@@ -16,7 +16,6 @@
 #include "Base/Util/Assert.h"
 #include "GUI/Model/Mask/MaskItems.h"
 #include "GUI/Model/Mask/MasksSet.h"
-#include "GUI/Model/Mask/ProjectionsSet.h"
 
 // Implementation of MasksQModel is based on the Qt source code for QStringListModel
 
@@ -105,16 +104,6 @@ void MasksQModel::clear()
     QAbstractListModel::endResetModel();
 }
 
-ProjectionsSet* MasksQModel::projnItem()
-{
-    return dynamic_cast<ProjectionsSet*>(m_masks);
-}
-
-const ProjectionsSet* MasksQModel::projnItem() const
-{
-    return dynamic_cast<const ProjectionsSet*>(m_masks);
-}
-
 void MasksQModel::moveUp()
 {
     for (const QModelIndex& itemIndex : m_selection_model->selectedIndexes()) {
diff --git a/GUI/Model/Mask/MasksQModel.h b/GUI/Model/Mask/MasksQModel.h
index 66ee061400c6b02d18f0b81756c34dc3bb8232b0..9f4e233b4331d9191895074d1383d9d692340113 100644
--- a/GUI/Model/Mask/MasksQModel.h
+++ b/GUI/Model/Mask/MasksQModel.h
@@ -23,7 +23,6 @@
 class MaskItem;
 class MasksSet;
 class OverlayItem;
-class ProjectionsSet;
 
 //! Provides interfaces to a MasksSet, allowing its contents to be displayed and modified
 //! using the Qt mechanisms.
@@ -60,8 +59,6 @@ public:
 
     MasksSet* masksSet() { return m_masks; }
     const MasksSet* masksSet() const { return m_masks; }
-    ProjectionsSet* projnItem();
-    const ProjectionsSet* projnItem() const;
 
 private:
     MasksSet* m_masks;
diff --git a/GUI/Model/Mask/MasksSet.h b/GUI/Model/Mask/MasksSet.h
index 1d30c3131ad88bbe94d753bd49a63605e761487d..b39dbfd1f68a282197ab3a631d86c7841ce1cbaf 100644
--- a/GUI/Model/Mask/MasksSet.h
+++ b/GUI/Model/Mask/MasksSet.h
@@ -28,7 +28,7 @@ class RegionOfInterestItem;
 class MasksSet {
 public:
     MasksSet();
-    virtual ~MasksSet();
+    ~MasksSet();
 
     const std::vector<MaskItem*>& maskItems() const { return m_mask_items.shared(); }
 
diff --git a/GUI/Model/Mask/ProjectionsSet.cpp b/GUI/Model/Mask/ProjectionsSet.cpp
deleted file mode 100644
index fcb5f4d82a72c0e1f926e6e01ec18dbe27bc6fe1..0000000000000000000000000000000000000000
--- a/GUI/Model/Mask/ProjectionsSet.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//  ************************************************************************************************
-//
-//  BornAgain: simulate and fit reflection and scattering
-//
-//! @file      GUI/Model/Mask/ProjectionsSet.cpp
-//! @brief     Implements items related to projections over color map.
-//!
-//! @homepage  http://www.bornagainproject.org
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2018
-//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-//
-//  ************************************************************************************************
-
-#include "GUI/Model/Mask/ProjectionsSet.h"
-#include "GUI/Model/Mask/MaskItems.h"
-
-ProjectionsSet::ProjectionsSet() = default;
-
-QVector<const LineItem*> ProjectionsSet::projectionsOfType(Qt::Orientation projectionType) const
-{
-    if (projectionType == Qt::Horizontal)
-        return projections<HorizontalLineItem>();
-    else if (projectionType == Qt::Vertical)
-        return projections<VerticalLineItem>();
-    else
-        ASSERT_NEVER;
-}
diff --git a/GUI/Model/Mask/ProjectionsSet.h b/GUI/Model/Mask/ProjectionsSet.h
deleted file mode 100644
index a8fa6505e0127d6e4096455729bc83514d26e6b8..0000000000000000000000000000000000000000
--- a/GUI/Model/Mask/ProjectionsSet.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//  ************************************************************************************************
-//
-//  BornAgain: simulate and fit reflection and scattering
-//
-//! @file      GUI/Model/Mask/ProjectionsSet.h
-//! @brief     Defines items related to projections over color map.
-//!
-//! @homepage  http://www.bornagainproject.org
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2018
-//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-//
-//  ************************************************************************************************
-
-#ifndef BORNAGAIN_GUI_MODEL_MASK_PROJECTIONSSET_H
-#define BORNAGAIN_GUI_MODEL_MASK_PROJECTIONSSET_H
-
-#include "GUI/Model/Mask/MasksSet.h"
-#include "GUI/Support/Data/ID.h"
-
-class LineItem;
-
-//! A container to hold ProjectionsSet, intended to store projections of color map on X, Y
-//! axes.
-
-class ProjectionsSet : public MasksSet {
-public:
-    ProjectionsSet();
-
-    QVector<const LineItem*> projectionsOfType(Qt::Orientation projectionType) const;
-
-private:
-    template <typename LineType> QVector<const LineItem*> projections() const
-    {
-        QVector<const LineItem*> result;
-        for (const auto* proj : m_mask_items)
-            if (const auto* line_item = dynamic_cast<const LineType*>(proj))
-                result.push_back(line_item);
-        return result;
-    }
-};
-
-
-#endif // BORNAGAIN_GUI_MODEL_MASK_PROJECTIONSSET_H
diff --git a/GUI/View/Canvas/MaskEditorCanvas.cpp b/GUI/View/Canvas/MaskEditorCanvas.cpp
index fc8d6a057f338bdb60ddc31e5110ed3c209f317f..077ac512f2cb05219bf87bf26e50e509e17de1a7 100644
--- a/GUI/View/Canvas/MaskEditorCanvas.cpp
+++ b/GUI/View/Canvas/MaskEditorCanvas.cpp
@@ -18,7 +18,6 @@
 #include "GUI/Model/Mask/MaskItems.h"
 #include "GUI/Model/Mask/MasksQModel.h"
 #include "GUI/Model/Mask/MasksSet.h"
-#include "GUI/Model/Mask/ProjectionsSet.h"
 #include "GUI/Model/Project/ProjectDocument.h"
 #include "GUI/View/Canvas/SavePlotAssistant.h"
 #include "GUI/View/Plotter/ColorMap.h"
diff --git a/GUI/View/Plotter/ProjectionsPlot.cpp b/GUI/View/Plotter/ProjectionsPlot.cpp
index e1358229522ab656eeab04fb23f54c0c268f4217..d1177ccf99e50c6bd1203614e5e19b10627f3366 100644
--- a/GUI/View/Plotter/ProjectionsPlot.cpp
+++ b/GUI/View/Plotter/ProjectionsPlot.cpp
@@ -21,7 +21,7 @@
 #include "GUI/Model/Data/Data2DItem.h"
 #include "GUI/Model/Data/RangeUtil.h"
 #include "GUI/Model/Mask/MaskItems.h"
-#include "GUI/Model/Mask/ProjectionsSet.h"
+#include "GUI/Model/Mask/MasksSet.h"
 #include "GUI/Support/Style/QCP_Util.h"
 #include "GUI/Support/Style/Style.h"
 #include <qcustomplot.h>
@@ -161,7 +161,6 @@ void ProjectionsPlot::updateProjectionsData()
 {
     if (!m_data_item)
         return;
-
     updateAxesRange();
     updateAxesTitle();
     setLogz(m_data_item->isLog());
@@ -173,12 +172,13 @@ void ProjectionsPlot::updateProjectionsData()
 void ProjectionsPlot::updateProjections()
 {
     ASSERT(m_data_item);
-    auto* container_item = m_data_item->projectionsSet();
-    if (!container_item)
+    auto* all_prjns = m_data_item->projectionsSet();
+    if (!all_prjns)
         return;
-    const auto projn_items = container_item->projectionsOfType(m_orientation);
-    for (const auto* projItem : projn_items)
-        setGraphFromItem(projItem);
+    for (const auto* prjn : all_prjns->maskItems())
+        if (const auto* t = dynamic_cast<const LineItem*>(prjn))
+            if (t->orientation() == m_orientation)
+                setGraphFromItem(t);
     replot();
 }
 
diff --git a/GUI/View/Scene/OverlayFactory.cpp b/GUI/View/Scene/OverlayFactory.cpp
index 384bda93e5fc51108326dd5755224327eb328d7b..dd0d27ae39be7e110a107cb4b84fdba7198ab09f 100644
--- a/GUI/View/Scene/OverlayFactory.cpp
+++ b/GUI/View/Scene/OverlayFactory.cpp
@@ -16,7 +16,6 @@
 #include "Base/Util/Assert.h"
 #include "GUI/Model/Mask/MaskItems.h"
 #include "GUI/Model/Mask/PointItem.h"
-#include "GUI/Model/Mask/ProjectionsSet.h"
 #include "GUI/View/Overlay/EllipseOverlay.h"
 #include "GUI/View/Overlay/FullframeOverlay.h"
 #include "GUI/View/Overlay/LineOverlays.h"
diff --git a/GUI/View/Setup/ProjectionsSaver.cpp b/GUI/View/Setup/ProjectionsSaver.cpp
index d887ba7871428dd84eb50bfc373cc8c071366ab9..503304f63f7f30b2adf4acaa2905b1aa04790e0b 100644
--- a/GUI/View/Setup/ProjectionsSaver.cpp
+++ b/GUI/View/Setup/ProjectionsSaver.cpp
@@ -18,7 +18,7 @@
 #include "Device/Data/Datafield.h"
 #include "GUI/Model/Data/Data2DItem.h"
 #include "GUI/Model/Mask/MaskItems.h"
-#include "GUI/Model/Mask/ProjectionsSet.h"
+#include "GUI/Model/Mask/MasksSet.h"
 #include "GUI/Model/Project/ProjectDocument.h"
 #include "GUI/View/Layout/ApplicationSettings.h"
 #include <QFileDialog>
@@ -26,11 +26,8 @@
 #include <QTextStream>
 #include <QVector>
 #include <QWidget>
-#include <boost/polymorphic_cast.hpp>
 #include <memory>
 
-using boost::polymorphic_downcast;
-
 namespace {
 
 const int bin_centers_colwidth = 12;
@@ -48,25 +45,19 @@ QString to_double_str(double value)
     return QString("%1").arg(QString::fromStdString(str), -bin_centers_colwidth);
 }
 
-bool vert_less_posx(const OverlayItem* item1, const OverlayItem* item2)
-{
-    return polymorphic_downcast<const VerticalLineItem*>(item1)->pos()
-           < polymorphic_downcast<const VerticalLineItem*>(item2)->pos();
-}
-
-bool horiz_less_posy(const OverlayItem* item1, const OverlayItem* item2)
-{
-    return polymorphic_downcast<const HorizontalLineItem*>(item1)->pos()
-           < polymorphic_downcast<const HorizontalLineItem*>(item2)->pos();
-}
-
-//! Returns vector of ProjectionsSet sorted according to axis value.
-QVector<const LineItem*> projectionItems(Qt::Orientation projectionsType,
-                                         const Data2DItem* data_item)
+//! Returns horizontal or vertical cuts, sorted by position.
+QVector<const LineItem*> projectionItems(Qt::Orientation ori, const Data2DItem* data_item)
 {
-    auto result = data_item->projectionsSet()->projectionsOfType(projectionsType);
+    const auto* pset = data_item->projectionsSet();
+    if (!pset)
+        return {};
+    QVector<const LineItem*> result;
+    for (const MaskItem* m : pset->maskItems())
+        if (const auto* t = dynamic_cast<const LineItem*>(m))
+            if (t->orientation() == ori)
+                result.push_back(t);
     std::sort(result.begin(), result.end(),
-              projectionsType == Qt::Horizontal ? horiz_less_posy : vert_less_posx);
+              [](const LineItem* t1, const LineItem* t2) { return t1->pos() < t2->pos(); });
     return result;
 }