diff --git a/GUI/View/Device/DetectorAlignmentForm.cpp b/GUI/View/Device/DetectorAlignmentForm.cpp
index dd23d43fa4a8d6d4d12aeb6b125c64fcf350992f..b91ba86f96a9932fa5cb3090c4b1d28f8020e3d4 100644
--- a/GUI/View/Device/DetectorAlignmentForm.cpp
+++ b/GUI/View/Device/DetectorAlignmentForm.cpp
@@ -44,9 +44,8 @@ DoubleSpinBox* createSpinBox(QFormLayout* parentFormLayout,
 
 DetectorAlignmentForm::DetectorAlignmentForm(QWidget* parent, DetectorItem* item)
     : QWidget(parent)
-    , m_item(item)
 {
-    ASSERT(m_item);
+    ASSERT(item);
     QFormLayout* mainLayout = new QFormLayout(this);
     mainLayout->setContentsMargins(0, 15, 0, 0);
     mainLayout->setSpacing(8);
@@ -58,18 +57,18 @@ DetectorAlignmentForm::DetectorAlignmentForm(QWidget* parent, DetectorItem* item
                                              emit dataChanged();
                                          }));
 
-    m_formLayout = new QFormLayout;
-    m_formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
-    m_formLayout->setContentsMargins(0, 0, 0, 0);
-    mainLayout->addRow(m_formLayout);
+    auto* detposLayout = new QFormLayout;
+    detposLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
+    detposLayout->setContentsMargins(0, 0, 0, 0);
+    mainLayout->addRow(detposLayout);
 
-    GUI::Util::Layout::clearLayout(m_formLayout);
+    GUI::Util::Layout::clearLayout(detposLayout);
 
-    const QString& descr = alignmentDescription.at(m_item->detectorAlignment());
+    const QString& descr = alignmentDescription.at(item->detectorAlignment());
 
     auto* layoutUVD = new QFormLayout;
-    createSpinBox(layoutUVD, m_item->u0(), this);
-    createSpinBox(layoutUVD, m_item->v0(), this);
-    createSpinBox(layoutUVD, m_item->distance(), this);
-    m_formLayout->addRow(descr + ":", layoutUVD);
+    createSpinBox(layoutUVD, item->u0(), this);
+    createSpinBox(layoutUVD, item->v0(), this);
+    createSpinBox(layoutUVD, item->distance(), this);
+    detposLayout->addRow(descr + ":", layoutUVD);
 }
diff --git a/GUI/View/Device/DetectorAlignmentForm.h b/GUI/View/Device/DetectorAlignmentForm.h
index 86510f625b06313c2e83aa8297ba20d4457a0c56..1e0e4e0223f690b60ef1317b4b111249fed12c14 100644
--- a/GUI/View/Device/DetectorAlignmentForm.h
+++ b/GUI/View/Device/DetectorAlignmentForm.h
@@ -32,10 +32,6 @@ public:
 
 signals:
     void dataChanged();
-
-private:
-    DetectorItem* m_item;
-    QFormLayout* m_formLayout;
 };
 
 #endif // BORNAGAIN_GUI_VIEW_DEVICE_DETECTORALIGNMENTFORM_H