diff --git a/DynamicModel.cc b/DynamicModel.cc
index f27b1ca3db2ff464357a6dff338cb44f201267c8..e881b30231fcb9d4b1ac9784d52b8275a03c72cb 100644
--- a/DynamicModel.cc
+++ b/DynamicModel.cc
@@ -3429,47 +3429,6 @@ DynamicModel::writeDynamicFile(const string &basename, bool block, bool bytecode
     writeDynamicMFile(t_basename);
 }
 
-void
-DynamicModel::reindexTrendSymbolsMap(DynamicModel &dynamic_model, SymbolTable &orig_symbol_table)
-{
-  map<int, expr_t> orig_trend_symbols_map = trend_symbols_map;
-  trend_symbols_map.clear();
-  for (map<int, expr_t>::const_iterator it = orig_trend_symbols_map.begin();
-       it != orig_trend_symbols_map.end(); it++)
-    try
-      {
-        vector<int> symb_id (1, symbol_table.getID(orig_symbol_table.getName(it->first)));
-        addTrendVariables(symb_id,
-                          it->second->cloneDynamicReindex(dynamic_model, orig_symbol_table));
-      }
-    catch(...)
-      {
-        cerr << "Error: unused exo in trend symbols." << endl;
-        exit(EXIT_FAILURE);
-      }
-}
-
-void
-DynamicModel::reindexNonstationarySymbolsMap(DynamicModel &dynamic_model, SymbolTable &orig_symbol_table)
-{
-  nonstationary_symbols_map_t orig_nonstationary_symbols_map = nonstationary_symbols_map;
-  nonstationary_symbols_map.clear();
-  for (nonstationary_symbols_map_t::const_iterator it = orig_nonstationary_symbols_map.begin();
-       it != orig_nonstationary_symbols_map.end(); it++)
-    try
-      {
-        vector<int> symb_id (1, symbol_table.getID(orig_symbol_table.getName(it->first)));
-        addNonstationaryVariables(symb_id,
-                                  it->second.first,
-                                  it->second.second->cloneDynamicReindex(dynamic_model, orig_symbol_table));
-      }
-  catch(...)
-      {
-        cerr << "Error: unused exo in nonstationary symbols." << endl;
-        exit(EXIT_FAILURE);
-      }
-}
-
 void
 DynamicModel::resetDataTree()
 {
@@ -3483,22 +3442,6 @@ DynamicModel::resetDataTree()
   second_deriv_external_function_node_map.clear();
 }
 
-void
-DynamicModel::reindexEquations(DynamicModel &dynamic_model, SymbolTable &orig_symbol_table)
-{
-  map<int, expr_t> orig_local_variables_table = local_variables_table;
-  local_variables_table.clear();
-  for (map<int, expr_t>::const_iterator it = orig_local_variables_table.begin();
-       it != orig_local_variables_table.end(); it++)
-    dynamic_model.AddLocalVariable(symbol_table.getID(orig_symbol_table.getName(it->first)),
-                                   it->second->cloneDynamicReindex(dynamic_model, orig_symbol_table));
-
-  vector<BinaryOpNode *>eqbak = equations;
-  equations.clear();
-  for (size_t i = 0; i < eqbak.size(); i++)
-    dynamic_model.addEquation(eqbak[i]->cloneDynamicReindex(dynamic_model, orig_symbol_table), equations_lineno[i]);
-}
-
 void
 DynamicModel::cloneDynamic(DynamicModel &dynamic_model) const
 {
diff --git a/DynamicModel.hh b/DynamicModel.hh
index 79f085debbd9a76e81e8dc43b37bc6109ac77b83..e6a5667591edc4b26504d694d548b5fe39a2f09e 100644
--- a/DynamicModel.hh
+++ b/DynamicModel.hh
@@ -235,15 +235,6 @@ public:
   /*! It assumes that the dynamic model given in argument has just been allocated */
   void cloneDynamic(DynamicModel &dynamic_model) const;
 
-  //! reindex equations after change in symbol_table
-  void reindexEquations(DynamicModel &dynamic_model, SymbolTable &orig_symbol_table);
-
-  //! reindex trend_symbol_map after change in symbol_table
-  void reindexTrendSymbolsMap(DynamicModel &dynamic_model, SymbolTable &orig_symbol_table);
-
-  //! reindex nonstationary_symbol_map after change in symbol_table
-  void reindexNonstationarySymbolsMap(DynamicModel &dynamic_model, SymbolTable &orig_symbol_table);
-
   //! reset DataTree vars
   void resetDataTree();
 
diff --git a/ModFile.cc b/ModFile.cc
index 570ad72adc2a70db452aa76e94111597fa036e1b..d9f36dbb7f3c2d6bcf3d20988b53832f965ff82f 100644
--- a/ModFile.cc
+++ b/ModFile.cc
@@ -314,7 +314,7 @@ ModFile::transformPass(bool nostrict)
       SymbolTable orig_symbol_table = symbol_table;
       symbol_table.rmExo(unusedExo);
       dynamic_model.resetDataTree();
-      dynamic_model.reindexEquations(dynamic_model, orig_symbol_table);
+      dynamic_model.reindex(orig_symbol_table);
       vector<Statement *> orig_statements = statements;
       statements.clear();
       for (vector<Statement *>::iterator it = orig_statements.begin(); it != orig_statements.end(); it++)
diff --git a/ModelTree.cc b/ModelTree.cc
index 688d4f292d888d43c533a40456f871dc2f976cc4..b95a508e2c1390924208e3578e7cdc380c919214 100644
--- a/ModelTree.cc
+++ b/ModelTree.cc
@@ -1413,6 +1413,70 @@ ModelTree::addAuxEquation(expr_t eq)
   aux_equations.push_back(beq);
 }
 
+void
+ModelTree::reindex(SymbolTable &orig_symbol_table)
+{
+  reindexEquations(orig_symbol_table);
+  reindexTrendSymbolsMap(orig_symbol_table);
+  reindexNonstationarySymbolsMap(orig_symbol_table);
+}
+
+void
+ModelTree::reindexEquations(SymbolTable &orig_symbol_table)
+{
+  map<int, expr_t> orig_local_variables_table = local_variables_table;
+  local_variables_table.clear();
+  for (map<int, expr_t>::const_iterator it = orig_local_variables_table.begin();
+       it != orig_local_variables_table.end(); it++)
+    AddLocalVariable(symbol_table.getID(orig_symbol_table.getName(it->first)),
+                     it->second->cloneDynamicReindex(*this, orig_symbol_table));
+
+  vector<BinaryOpNode *>eqbak = equations;
+  equations.clear();
+  for (size_t i = 0; i < eqbak.size(); i++)
+    addEquation(eqbak[i]->cloneDynamicReindex(*this, orig_symbol_table), equations_lineno[i]);
+}
+
+void
+ModelTree::reindexTrendSymbolsMap(SymbolTable &orig_symbol_table)
+{
+  map<int, expr_t> orig_trend_symbols_map = trend_symbols_map;
+  trend_symbols_map.clear();
+  for (map<int, expr_t>::const_iterator it = orig_trend_symbols_map.begin();
+       it != orig_trend_symbols_map.end(); it++)
+    try
+      {
+        vector<int> symb_id (1, symbol_table.getID(orig_symbol_table.getName(it->first)));
+        addTrendVariables(symb_id, it->second->cloneDynamicReindex(*this, orig_symbol_table));
+      }
+    catch(...)
+      {
+        cerr << "Error: unused exo in trend symbols." << endl;
+        exit(EXIT_FAILURE);
+      }
+}
+
+void
+ModelTree::reindexNonstationarySymbolsMap(SymbolTable &orig_symbol_table)
+{
+  nonstationary_symbols_map_t orig_nonstationary_symbols_map = nonstationary_symbols_map;
+  nonstationary_symbols_map.clear();
+  for (nonstationary_symbols_map_t::const_iterator it = orig_nonstationary_symbols_map.begin();
+       it != orig_nonstationary_symbols_map.end(); it++)
+    try
+      {
+        vector<int> symb_id (1, symbol_table.getID(orig_symbol_table.getName(it->first)));
+        addNonstationaryVariables(symb_id,
+                                  it->second.first,
+                                  it->second.second->cloneDynamicReindex(*this, orig_symbol_table));
+      }
+  catch(...)
+      {
+        cerr << "Error: unused exo in nonstationary symbols." << endl;
+        exit(EXIT_FAILURE);
+      }
+}
+
 void
 ModelTree::addTrendVariables(vector<int> trend_vars, expr_t growth_factor) throw (TrendException)
 {
diff --git a/ModelTree.hh b/ModelTree.hh
index 4d161daf8bf027a91cf6c85ba8fc42c848dcd25b..b86376b2aebc9c348773e89ac900df4c69fa41e5 100644
--- a/ModelTree.hh
+++ b/ModelTree.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2014 Dynare Team
+ * Copyright (C) 2003-2015 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -303,6 +303,13 @@ public:
   void addEquation(expr_t eq, int lineno, vector<pair<string, string> > &eq_tags);
   //! Declare a node as an auxiliary equation of the model, adding it at the end of the list of auxiliary equations
   void addAuxEquation(expr_t eq);
+  void reindex(SymbolTable &orig_symbol_table);
+  //! reindex equations after change in symbol_table
+  void reindexEquations(SymbolTable &orig_symbol_table);
+  //! reindex trend_symbol_map after change in symbol_table
+  void reindexTrendSymbolsMap(SymbolTable &orig_symbol_table);
+  //! reindex nonstationary_symbol_map after change in symbol_table
+  void reindexNonstationarySymbolsMap(SymbolTable &orig_symbol_table);
   //! Returns the number of equations in the model
   int equation_number() const;
   //! Adds a trend variable with its growth factor