diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 577012f0fa3e870a32a0b58e58a27e9290701396..6e3c1b18b089ed3a262af140452a0351ab4ed78d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -73,6 +73,7 @@ set(CPP_FILES
   core/labeling/labelingmethod.cpp
   core/masschroq_run/masschroqbatchprocess.cpp
   core/masschroq_run/masschroqcondorprocess.cpp
+  core/masschroq_run/masschroqfileparameters.cpp
   core/mcqr/mcqrexperiment.cpp
   core/qvalue/computeqvalues.cpp
   core/tandem_run/tandembatchprocess.cpp
@@ -177,7 +178,6 @@ set(XTPCPP_SRCS
   ./gui/lists/ms_identification_run_list_view/ms_identification_worker/msidlistworkerstatus.cpp
   ./gui/lists/ms_identification_run_list_view/engine_detail_view/enginedetailwindow.cpp
   ./gui/masschroq_run_dialog/masschroqrundialog.cpp
-  ./gui/masschroq_run_dialog/masschroqfileparameters.cpp
   ./gui/mcqr_param_dialog/mcqrparamallquantidialog.cpp
   ./gui/mcqr_run_view/mcqrparamwidget.cpp
   ./gui/mcqr_run_view/mcqrrunview.cpp
diff --git a/src/core/alignmentgroup.cpp b/src/core/alignmentgroup.cpp
index 45a8b9319d446aedf53325e9c1970c186db466c6..175d2b34b49ba421b4a4af3c1ec4cef7235b61e4 100644
--- a/src/core/alignmentgroup.cpp
+++ b/src/core/alignmentgroup.cpp
@@ -175,14 +175,9 @@ MsRunAlignmentGroup::prepareMsrunRetentionTimesForAlignment() const
 }
 
 void
-MsRunAlignmentGroup::savePostMassChroqmlParameters(
-  MasschroqFileParameters file_parameters,
-  ZivyParams zivy_params,
-  QString masschroqml_file)
+MsRunAlignmentGroup::savePostMassChroqmlParameters(QString masschroqml_file)
 {
-  m_masschroqFileParameters = file_parameters;
-  m_zivyParams              = zivy_params;
-  m_masschroqmlPath         = masschroqml_file;
+  m_masschroqmlPath = masschroqml_file;
 }
 
 void
@@ -203,11 +198,6 @@ MsRunAlignmentGroup::getGroupStatus()
   return m_status;
 }
 
-MasschroqFileParameters
-MsRunAlignmentGroup::getMassChroQFileParams()
-{
-  return m_masschroqFileParameters;
-}
 
 QString
 MsRunAlignmentGroup::getMassChroqmlPath()
@@ -215,17 +205,6 @@ MsRunAlignmentGroup::getMassChroqmlPath()
   return m_masschroqmlPath;
 }
 
-ZivyParams
-MsRunAlignmentGroup::getZivyParams()
-{
-  return m_zivyParams;
-}
-
-void
-MsRunAlignmentGroup::setMassChroQFileParams(MasschroqFileParameters mcq_params)
-{
-  m_masschroqFileParameters = mcq_params;
-}
 
 void
 MsRunAlignmentGroup::setMassChroqmlPath(QString masschroqml_path)
@@ -233,11 +212,6 @@ MsRunAlignmentGroup::setMassChroqmlPath(QString masschroqml_path)
   m_masschroqmlPath = masschroqml_path;
 }
 
-void
-MsRunAlignmentGroup::setZivyParams(ZivyParams zivy_params)
-{
-  m_zivyParams = zivy_params;
-}
 
 QString
 MsRunAlignmentGroup::getMassChroqmlRdataPath() const
diff --git a/src/core/alignmentgroup.h b/src/core/alignmentgroup.h
index a7b7fa11097e1497743856c9bb9fb652a510a455..c1dec0ab6c3c0053177622d7b11a0b836cf085a9 100644
--- a/src/core/alignmentgroup.h
+++ b/src/core/alignmentgroup.h
@@ -25,9 +25,8 @@
 #include <QDebug>
 #include <memory>
 #include "msrun.h"
-// #include "project.h"
-#include "../gui/masschroq_run_dialog/masschroqfileparameters.h"
 #include "../gui/xic_view/xic_widgets/zivywidget.h"
+#include "masschroq_run/masschroqfileparameters.h"
 
 enum class AlignmentGroupStatus : std::int8_t
 {
@@ -61,17 +60,11 @@ class MsRunAlignmentGroup
   void removeMsRunFromMsRunAlignmentGroupList(MsRunSp removed_msrun);
   void prepareMsrunRetentionTimesForAlignment() const;
 
-  void savePostMassChroqmlParameters(MasschroqFileParameters file_parameters,
-                                     ZivyParams zivy_params,
-                                     QString masschroqml_file);
+  void savePostMassChroqmlParameters(QString masschroqml_file);
   void setMassChroQRunStatus(AlignmentGroupStatus status);
   void setMassChroQRunStatusFromInt(int status);
   AlignmentGroupStatus getGroupStatus();
-  MasschroqFileParameters getMassChroQFileParams();
-  ZivyParams getZivyParams();
   QString getMassChroqmlPath();
-  void setMassChroQFileParams(MasschroqFileParameters mcq_params);
-  void setZivyParams(ZivyParams zivy_params);
   void setMassChroqmlPath(QString masschroqml_path);
 
   QString getMassChroqmlRdataPath() const;
@@ -85,7 +78,6 @@ class MsRunAlignmentGroup
 
   // Post MassChroQ run params
   AlignmentGroupStatus m_status;
-  MasschroqFileParameters m_masschroqFileParameters;
-  ZivyParams m_zivyParams;
+  MasschroqFileParametersSp msp_masschroqFileParametersSp;
   QString m_masschroqmlPath;
 };
diff --git a/src/gui/masschroq_run_dialog/masschroqfileparameters.cpp b/src/core/masschroq_run/masschroqfileparameters.cpp
similarity index 98%
rename from src/gui/masschroq_run_dialog/masschroqfileparameters.cpp
rename to src/core/masschroq_run/masschroqfileparameters.cpp
index 28e674212f007d6c1e7ba8f95b98bce09a413e23..b7549ecea45d4dacfda334621775b5c444c39609 100644
--- a/src/gui/masschroq_run_dialog/masschroqfileparameters.cpp
+++ b/src/core/masschroq_run/masschroqfileparameters.cpp
@@ -1,5 +1,5 @@
 /**
- * \file gui/export/export_masschroq_dialog/masschroqfileparameters.cpp
+ * \file src/core/masschroq_run/masschroqfileparameters.cpp
  * \date 25/01/2019
  * \author Olivier Langella
  * \brief all needed information to write a MassChroqML file
diff --git a/src/gui/masschroq_run_dialog/masschroqfileparameters.h b/src/core/masschroq_run/masschroqfileparameters.h
similarity index 80%
rename from src/gui/masschroq_run_dialog/masschroqfileparameters.h
rename to src/core/masschroq_run/masschroqfileparameters.h
index 9443f30a03235d80c1aa7920df76b243e1f83534..8be09382892459bcd20a6f5fdd0fe72f051fe3d8 100644
--- a/src/gui/masschroq_run_dialog/masschroqfileparameters.h
+++ b/src/core/masschroq_run/masschroqfileparameters.h
@@ -1,5 +1,5 @@
 /**
- * \file gui/export/export_masschroq_dialog/masschroqfileparameters.h
+ * \file src/core/masschroq_run/masschroqfileparameters.h
  * \date 25/01/2019
  * \author Olivier Langella
  * \brief all needed information to write a MassChroqML file
@@ -23,9 +23,6 @@
  *     You should have received a copy of the GNU General Public License
  *     along with XTPcpp.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Contributors:
- *     Olivier Langella <olivier.langella@u-psud.fr> - initial API and
- *implementation
  ******************************************************************************/
 
 #pragma once
@@ -34,11 +31,28 @@
 #include <QString>
 #include <pappsomspp/mzrange.h>
 #include <pappsomspp/processing/filters/filtersuitestring.h>
+#include <pappsomspp/processing/detection/tracedetectionzivy.h>
 #include "../../core/msrun.h"
 
 class MasschroqFileParameters;
 typedef std::shared_ptr<MasschroqFileParameters> MasschroqFileParametersSp;
 
+
+struct ZivyParams
+{
+  std::shared_ptr<pappso::TraceDetectionInterface>
+  newTraceDetectionZivySPtr() const;
+  void saveSettings() const;
+  void loadSettings();
+
+  unsigned int _maxmin_half_window    = 3;
+  unsigned int _minmax_half_window    = 2;
+  double _maxmin_threshold            = 3000;
+  double _minmax_threshold            = 5000;
+  unsigned int _smoothing_half_window = 1;
+};
+
+
 struct MasschroqFileParameters
 {
   void save() const;
@@ -69,4 +83,6 @@ struct MasschroqFileParameters
   pappso::FilterSuiteStringSPtr msp_xicFilterSuiteString;
 
   std::vector<MsRunAlignmentGroupSp> alignment_groups;
+
+  ZivyParams m_zivyParams;
 };
diff --git a/src/core/project.cpp b/src/core/project.cpp
index da3f3f59a96cd2e509ce8bcbdc372a48ab188e63..a3474556814256e3d3d2aab2ee4f1e4483a1a448 100644
--- a/src/core/project.cpp
+++ b/src/core/project.cpp
@@ -30,6 +30,8 @@
 Project::Project()
 {
   msp_masschroqFileParametersSp = std::make_shared<MasschroqFileParameters>();
+  msp_masschroqFileParametersSp.get()->load();
+  msp_masschroqFileParametersSp.get()->m_zivyParams.loadSettings();
 }
 
 Project::~Project()
@@ -273,8 +275,8 @@ Project::startGrouping(WorkMonitorInterface *p_work_monitor)
   qDebug();
   for(IdentificationGroup *p_id_group : _identification_goup_list)
     {
-      p_id_group->startGrouping(m_contaminantRemovalMode, m_groupingType,
-                                p_work_monitor);
+      p_id_group->startGrouping(
+        m_contaminantRemovalMode, m_groupingType, p_work_monitor);
     }
   qDebug();
 }
@@ -302,12 +304,14 @@ Project::hasPtmExperiment() const
 void
 Project::getSameXicPeptideEvidenceList(
   std::vector<const PeptideEvidence *> &peptide_evidence_list,
-  const MsRun *p_msrun, const PeptideXtp *p_peptide, unsigned int charge) const
+  const MsRun *p_msrun,
+  const PeptideXtp *p_peptide,
+  unsigned int charge) const
 {
   for(const IdentificationGroup *p_ident_group : _identification_goup_list)
     {
-      p_ident_group->getSameXicPeptideEvidenceList(peptide_evidence_list,
-                                                   p_msrun, p_peptide, charge);
+      p_ident_group->getSameXicPeptideEvidenceList(
+        peptide_evidence_list, p_msrun, p_peptide, charge);
     }
 }
 
diff --git a/src/core/project.h b/src/core/project.h
index 64b9299a99c10f14d681d8642a8734b7cd436b0a..f0fd181e469cea89861e2e6af1ca80d8258d6269 100644
--- a/src/core/project.h
+++ b/src/core/project.h
@@ -38,6 +38,7 @@
 #include "labeling/labelingmethod.h"
 #include "alignmentgroup.h"
 #include "mcqr/mcqrexperiment.h"
+#include "masschroq_run/masschroqfileparameters.h"
 
 class Project;
 typedef std::shared_ptr<Project> ProjectSp;
@@ -208,7 +209,8 @@ class Project
    */
   void getSameXicPeptideEvidenceList(
     std::vector<const PeptideEvidence *> &peptide_evidence_list,
-    const MsRun *p_msrun, const PeptideXtp *p_peptide,
+    const MsRun *p_msrun,
+    const PeptideXtp *p_peptide,
     unsigned int charge) const;
 
 
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index 026fcf853fb35675c1316459773f95b7bb6db07e..32bbacd5263d04e29d3960626bd57c109fe0c599 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -34,7 +34,6 @@
 #include <pappsomspp/pappsoexception.h>
 #include "../utils/utils.h"
 #include "output/xpip.h"
-#include "masschroq_run_dialog/masschroqfileparameters.h"
 
 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Main)
 {
diff --git a/src/gui/masschroq_run_dialog/masschroqrundialog.cpp b/src/gui/masschroq_run_dialog/masschroqrundialog.cpp
index b85191bba1b089ad5d07e2e86b94fdb2c23a9997..58276dd6603e2e15ec3a0f395f96eec6eda63e9e 100644
--- a/src/gui/masschroq_run_dialog/masschroqrundialog.cpp
+++ b/src/gui/masschroq_run_dialog/masschroqrundialog.cpp
@@ -61,6 +61,10 @@ MassChroqRunDialog::MassChroqRunDialog(MainWindow *parent,
   ui->ht_condor_memory_spin->setValue(
     settings.value("masschroq/condor_request_memory", "5000").toInt());
 
+
+  msp_masschroqFileParametersSp =
+    parent->getProjectSp().get()->getMasschroqFileParametersSp();
+
   setMassChroQRunParamTab();
   mp_poModel = new QStandardItemModel(ui->group_listView);
 
@@ -568,10 +572,7 @@ MassChroqRunDialog::updateAlignmentGroupsStatus(QString masschroqml_file)
             {
               group = msp_alignmentGroups.at(i - 1);
             }
-          ZivyParams zivy_params;
-          zivy_params.loadSettings();
-          group->savePostMassChroqmlParameters(
-            getMasschroqFileParameters(), zivy_params, masschroqml_file);
+          group->savePostMassChroqmlParameters(masschroqml_file);
           if(getMassChroqRunStatus() == true)
             {
               group->setMassChroQRunStatus(AlignmentGroupStatus::masschroq_run);
diff --git a/src/gui/masschroq_run_dialog/masschroqrundialog.h b/src/gui/masschroq_run_dialog/masschroqrundialog.h
index a35c9ede152be41a6fd11e02a43916615ba55be9..5786a8ac737f13fb7b6a5ed70301060b4853b221 100644
--- a/src/gui/masschroq_run_dialog/masschroqrundialog.h
+++ b/src/gui/masschroq_run_dialog/masschroqrundialog.h
@@ -30,8 +30,6 @@
 
 #pragma once
 
-#include "masschroqfileparameters.h"
-
 #include <QDialog>
 #include <QStandardItemModel>
 
@@ -108,4 +106,5 @@ class MassChroqRunDialog : public QDialog
   MsRunAlignmentGroupSp msp_allMsrunAlignmentGroup;
   QStandardItemModel *mp_poModel;
   MsRunAlignmentGroupSp msp_selected_group;
+  MasschroqFileParametersSp msp_masschroqFileParametersSp;
 };
diff --git a/src/gui/workerthread.h b/src/gui/workerthread.h
index 524073e4864b2eb691a4a4dd7bfb93a31af45fd7..b35caa30e87673b7f32e3fdaad82119ba850587c 100644
--- a/src/gui/workerthread.h
+++ b/src/gui/workerthread.h
@@ -37,7 +37,6 @@
 #include "../utils/workmonitor.h"
 #include "../core/tandem_run/tandemrunbatch.h"
 #include "../core/masschroq_run/masschroqrunbatch.h"
-#include "../gui/masschroq_run_dialog/masschroqfileparameters.h"
 #include "../gui/xic_view/xic_box/xicbox.h"
 
 class MainWindow;
diff --git a/src/gui/xic_view/xic_widgets/zivywidget.h b/src/gui/xic_view/xic_widgets/zivywidget.h
index 02022f19d7fe6ba06e547efd605bf718b035d633..174d5d007355bb9c0904f1214d919ca918a9b4ae 100644
--- a/src/gui/xic_view/xic_widgets/zivywidget.h
+++ b/src/gui/xic_view/xic_widgets/zivywidget.h
@@ -30,7 +30,7 @@
 #pragma once
 
 #include <QWidget>
-#include <pappsomspp/processing/detection/tracedetectionzivy.h>
+#include "../../../core/masschroq_run/masschroqfileparameters.h"
 
 namespace Ui
 {
@@ -38,20 +38,6 @@ class ZivyWidget;
 }
 
 
-struct ZivyParams
-{
-  std::shared_ptr<pappso::TraceDetectionInterface>
-  newTraceDetectionZivySPtr() const;
-  void saveSettings() const;
-  void loadSettings();
-
-  unsigned int _maxmin_half_window    = 3;
-  unsigned int _minmax_half_window    = 2;
-  double _maxmin_threshold            = 3000;
-  double _minmax_threshold            = 5000;
-  unsigned int _smoothing_half_window = 1;
-};
-
 class ZivyWidget : public QWidget
 {
   Q_OBJECT
diff --git a/src/input/xtpxpipsaxhandler.cpp b/src/input/xtpxpipsaxhandler.cpp
index 8449ec86ac9f4ac08f3a8736e520abed3f145614..bbc3601e8257997061140cbaeb1b230f742fa322 100644
--- a/src/input/xtpxpipsaxhandler.cpp
+++ b/src/input/xtpxpipsaxhandler.cpp
@@ -654,21 +654,23 @@ XtpXpipSaxHandler::startElement_msrunInAlignmentGroup(QXmlAttributes attributes)
 bool
 XtpXpipSaxHandler::startElement_alignment_param(QXmlAttributes attributes)
 {
-  m_massChroQFileParams.ms2_tendency_half_window =
+  MasschroqFileParameters *p_masschroq_file_params =
+    _p_project->getMasschroqFileParametersSp().get();
+  p_masschroq_file_params->ms2_tendency_half_window =
     attributes.value("ms2_tendency").toInt();
-  m_massChroQFileParams.ms2_smoothing_half_window =
+  p_masschroq_file_params->ms2_smoothing_half_window =
     attributes.value("ms2_smoothing").toInt();
-  m_massChroQFileParams.ms1_smoothing_half_window =
+  p_masschroq_file_params->ms1_smoothing_half_window =
     attributes.value("ms1_smoothing").toInt();
   if(!attributes.value("time_corrections").simplified().isEmpty())
     {
-      m_massChroQFileParams.write_alignment_times = true;
-      m_massChroQFileParams.alignment_times_directory =
+      p_masschroq_file_params->write_alignment_times = true;
+      p_masschroq_file_params->alignment_times_directory =
         attributes.value("time_corrections").simplified();
     }
   else
     {
-      m_massChroQFileParams.write_alignment_times = false;
+      p_masschroq_file_params->write_alignment_times = false;
     }
   return true;
 }
@@ -676,19 +678,22 @@ XtpXpipSaxHandler::startElement_alignment_param(QXmlAttributes attributes)
 bool
 XtpXpipSaxHandler::startElement_masschroq_param(QXmlAttributes attributes)
 {
+
+  MasschroqFileParameters *p_masschroq_file_params =
+    _p_project->getMasschroqFileParametersSp().get();
   msp_alignment_group->setMassChroqmlPath(attributes.value("masschroqml"));
   if(QFileInfo(attributes.value("result")).suffix() == "ods")
     {
-      m_massChroQFileParams.result_file_format = TableFileFormat::ods;
+      p_masschroq_file_params->result_file_format = TableFileFormat::ods;
     }
   else
     {
-      m_massChroQFileParams.result_file_format = TableFileFormat::tsv;
+      p_masschroq_file_params->result_file_format = TableFileFormat::tsv;
     }
 
   if(!attributes.value("compar").isEmpty())
     {
-      m_massChroQFileParams.export_compar_file = true;
+      p_masschroq_file_params->export_compar_file = true;
     }
   return true;
 }
@@ -696,26 +701,31 @@ XtpXpipSaxHandler::startElement_masschroq_param(QXmlAttributes attributes)
 bool
 XtpXpipSaxHandler::startElement_quantification_param(QXmlAttributes attributes)
 {
-  m_massChroQFileParams.xic_extraction_range =
+  MasschroqFileParameters *p_masschroq_file_params =
+    _p_project->getMasschroqFileParametersSp().get();
+  p_masschroq_file_params->xic_extraction_range =
     pappso::PrecisionFactory::fromString(attributes.value("xic_range"));
   if(attributes.value("xic_method").toInt() == 0)
     {
-      m_massChroQFileParams.xic_extraction_method =
+      p_masschroq_file_params->xic_extraction_method =
         pappso::XicExtractMethod::max;
     }
   else
     {
-      m_massChroQFileParams.xic_extraction_method =
+      p_masschroq_file_params->xic_extraction_method =
         pappso::XicExtractMethod::sum;
     }
 
-  ZivyParams zivy;
-  zivy._smoothing_half_window = attributes.value("smoothing").toInt();
-  zivy._minmax_half_window    = attributes.value("minmax_half").toInt();
-  zivy._maxmin_half_window    = attributes.value("maxmin_half").toInt();
-  zivy._minmax_threshold      = attributes.value("minmax_thre").toDouble();
-  zivy._maxmin_threshold      = attributes.value("maxmin_thre").toDouble();
-  msp_alignment_group->setZivyParams(zivy);
+  p_masschroq_file_params->m_zivyParams._smoothing_half_window =
+    attributes.value("smoothing").toInt();
+  p_masschroq_file_params->m_zivyParams._minmax_half_window =
+    attributes.value("minmax_half").toInt();
+  p_masschroq_file_params->m_zivyParams._maxmin_half_window =
+    attributes.value("maxmin_half").toInt();
+  p_masschroq_file_params->m_zivyParams._minmax_threshold =
+    attributes.value("minmax_thre").toDouble();
+  p_masschroq_file_params->m_zivyParams._maxmin_threshold =
+    attributes.value("maxmin_thre").toDouble();
   return true;
 }
 
@@ -1008,7 +1018,6 @@ XtpXpipSaxHandler::endElement_msrun()
 bool
 XtpXpipSaxHandler::endElement_alignmentGroup()
 {
-  msp_alignment_group->setMassChroQFileParams(m_massChroQFileParams);
   msp_alignment_group = nullptr;
   return true;
 }
diff --git a/src/input/xtpxpipsaxhandler.h b/src/input/xtpxpipsaxhandler.h
index fd4aa5e4585ae805e1e5a9a9c9e139ee4c9dccf1..65df3d3f1b0b221aec235470be615e24e9a787b2 100644
--- a/src/input/xtpxpipsaxhandler.h
+++ b/src/input/xtpxpipsaxhandler.h
@@ -130,7 +130,6 @@ class XtpXpipSaxHandler : public QXmlDefaultHandler
   LabelingMethodSp _sp_labeling_method;
   MsRunSp _sp_msrun;
   MsRunAlignmentGroupSp msp_alignment_group;
-  MasschroqFileParameters m_massChroQFileParams;
   std::map<QString, PeptideXtpSp> _map_peptides;
   bool _is_xtpcpp_xpip = false;
   QString _current_id;
diff --git a/src/output/masschroqml.cpp b/src/output/masschroqml.cpp
index 4d334defc20f8d4debbcbaf1d79aec022b2a8763..5624b2b3bcd398b83a91ed2931ab002c2537206e 100644
--- a/src/output/masschroqml.cpp
+++ b/src/output/masschroqml.cpp
@@ -91,8 +91,6 @@ MassChroQml::MassChroQml(const QString &out_filename,
 
   _output_stream->setAutoFormatting(true);
   _output_stream->writeStartDocument("1.0");
-
-  _detect_zivy.loadSettings();
 }
 
 MassChroQml::~MassChroQml()
@@ -376,27 +374,27 @@ MassChroQml::writeQuantificationMethods()
   //<mean_filter_half_edge>1</mean_filter_half_edge>
   _output_stream->writeStartElement("mean_filter_half_edge");
   _output_stream->writeCharacters(
-    QString("%1").arg(_detect_zivy._smoothing_half_window));
+    QString("%1").arg(m_params.m_zivyParams._smoothing_half_window));
   _output_stream->writeEndElement();
   //<minmax_half_edge>3</minmax_half_edge>
   _output_stream->writeStartElement("minmax_half_edge");
   _output_stream->writeCharacters(
-    QString("%1").arg(_detect_zivy._minmax_half_window));
+    QString("%1").arg(m_params.m_zivyParams._minmax_half_window));
   _output_stream->writeEndElement();
   //<maxmin_half_edge>2</maxmin_half_edge>
   _output_stream->writeStartElement("maxmin_half_edge");
   _output_stream->writeCharacters(
-    QString("%1").arg(_detect_zivy._maxmin_half_window));
+    QString("%1").arg(m_params.m_zivyParams._maxmin_half_window));
   _output_stream->writeEndElement();
   //<detection_threshold_on_max>5000</detection_threshold_on_max>
   _output_stream->writeStartElement("detection_threshold_on_max");
   _output_stream->writeCharacters(
-    QString("%1").arg(_detect_zivy._minmax_threshold));
+    QString("%1").arg(m_params.m_zivyParams._minmax_threshold));
   _output_stream->writeEndElement();
   //<detection_threshold_on_min>3000</detection_threshold_on_min>
   _output_stream->writeStartElement("detection_threshold_on_min");
   _output_stream->writeCharacters(
-    QString("%1").arg(_detect_zivy._maxmin_threshold));
+    QString("%1").arg(m_params.m_zivyParams._maxmin_threshold));
   _output_stream->writeEndElement();
   //</detection_zivy>
   _output_stream->writeEndElement();
diff --git a/src/output/masschroqml.h b/src/output/masschroqml.h
index e22486f8beb68aa571d3b487c4f5d5cfe57a266d..f7c368b253d5e6f3687620bc3689a72c64404fd9 100644
--- a/src/output/masschroqml.h
+++ b/src/output/masschroqml.h
@@ -37,7 +37,7 @@
 #include "../core/project.h"
 #include "../grouping/groupinggroup.h"
 #include "../gui/xic_view/xic_widgets/zivywidget.h"
-#include "../gui/masschroq_run_dialog/masschroqfileparameters.h"
+#include "../core/masschroq_run/masschroqfileparameters.h"
 
 class MassChroQml
 {
@@ -68,5 +68,4 @@ class MassChroQml
   QXmlStreamWriter *_output_stream;
   ProjectSp _sp_project;
   IdentificationGroup *_p_identification_group;
-  ZivyParams _detect_zivy;
 };
diff --git a/src/output/xpip.cpp b/src/output/xpip.cpp
index 7f641848ffdd5749c5709058bbfa197ea587c5d5..9e8385033ca82582027d6eb1120bcabc57522bcb 100644
--- a/src/output/xpip.cpp
+++ b/src/output/xpip.cpp
@@ -431,10 +431,9 @@ Xpip::writeMsrunAlignmentGroup(const MsRunAlignmentGroupSp alignment_group,
 void
 Xpip::writeAlignmentGroupParameters(const MsRunAlignmentGroupSp alignment_group)
 {
-  ZivyParams zivy_params   = alignment_group->getZivyParams();
   QString masschroqml_path = alignment_group->getMassChroqmlPath();
   MasschroqFileParameters mcq_file_params =
-    alignment_group->getMassChroQFileParams();
+    *(_sp_project.get()->getMasschroqFileParametersSp().get());
 
   // Alignment parameters
   _output_stream->writeStartElement("alignment_params");
@@ -465,15 +464,20 @@ Xpip::writeAlignmentGroupParameters(const MsRunAlignmentGroupSp alignment_group)
     "xic_method",
     QString::number((std::int8_t)mcq_file_params.xic_extraction_method));
   _output_stream->writeAttribute(
-    "smoothing", QString::number(zivy_params._smoothing_half_window));
+    "smoothing",
+    QString::number(mcq_file_params.m_zivyParams._smoothing_half_window));
   _output_stream->writeAttribute(
-    "minmax_half", QString::number(zivy_params._minmax_half_window));
+    "minmax_half",
+    QString::number(mcq_file_params.m_zivyParams._minmax_half_window));
   _output_stream->writeAttribute(
-    "maxmin_half", QString::number(zivy_params._maxmin_half_window));
+    "maxmin_half",
+    QString::number(mcq_file_params.m_zivyParams._maxmin_half_window));
   _output_stream->writeAttribute(
-    "minmax_thre", QString::number(zivy_params._minmax_threshold));
+    "minmax_thre",
+    QString::number(mcq_file_params.m_zivyParams._minmax_threshold));
   _output_stream->writeAttribute(
-    "maxmin_thre", QString::number(zivy_params._maxmin_threshold));
+    "maxmin_thre",
+    QString::number(mcq_file_params.m_zivyParams._maxmin_threshold));
   _output_stream->writeEndElement();
 
   // Masschroq parameters