diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc
index f6b44e9d632251ac3f3bdf601e081029205b924a..7dc7fb04da53f5871cdf538c3bb9033efc6d9de2 100644
--- a/src/DynamicModel.cc
+++ b/src/DynamicModel.cc
@@ -3994,34 +3994,40 @@ DynamicModel::getPacMaxLag(const string &pac_model_name, map<pair<string, string
 int
 DynamicModel::getPacTargetSymbId(const string &pac_model_name) const
 {
-  for (auto &equation : equations)
+  for (auto equation : equations)
     if (equation->containsPacExpectation(pac_model_name))
       {
         set<pair<int, int>> lhss;
         equation->arg1->collectDynamicVariables(SymbolType::endogenous, lhss);
+        if (lhss.size() != 1)
+          throw PacTargetNotIdentifiedException{pac_model_name, "LHS must contain a single endogenous"};
         int lhs_symb_id = lhss.begin()->first;
-        int lhs_orig_symb_id = lhs_symb_id;
-        if (symbol_table.isAuxiliaryVariable(lhs_symb_id))
+        if (!symbol_table.isDiffAuxiliaryVariable(lhs_symb_id))
+          throw PacTargetNotIdentifiedException{pac_model_name, "LHS must be a diff operator"};
+        int undiff_lhs_symb_id = symbol_table.getOrigSymbIdForAuxVar(lhs_symb_id);
+        auto barg2 = dynamic_cast<BinaryOpNode *>(equation->arg2);
+        if (!barg2)
+          throw PacTargetNotIdentifiedException{pac_model_name, "RHS must be a binary operator"};
+        auto [optim_share_index, optim_part, non_optim_part, additive_part]
+          = barg2->getPacOptimizingShareAndExprNodes(lhs_symb_id, undiff_lhs_symb_id);
+        /* If there is an optimization part, restrict the search to that part,
+           since it contains the MCE . */
+        expr_t mce = optim_part ? optim_part : equation->arg2;
+
+        vector<pair<expr_t, int>> terms;
+        mce->decomposeAdditiveTerms(terms);
+        for (auto [term, sign] : terms)
           try
             {
-              lhs_orig_symb_id = symbol_table.getOrigSymbIdForAuxVar(lhs_symb_id);
+              auto [param_id, target_id] = term->matchParamTimesTargetMinusVariable(undiff_lhs_symb_id);
+              return target_id;
             }
-          catch (...)
+          catch (ExprNode::MatchFailureException &)
             {
             }
-        auto barg2 = dynamic_cast<BinaryOpNode *>(equation->arg2);
-        assert(barg2);
-        auto [optim_share_index, optim_part, non_optim_part, additive_part]
-          = barg2->getPacOptimizingShareAndExprNodes(lhs_symb_id, lhs_orig_symb_id);
-        /* The algorithm for identifying the target is fragile. Hence, if there
-           is an optimization part, we restrict the search to that part to
-           avoid wrong results. */
-        if (optim_part)
-          return optim_part->getPacTargetSymbId(lhs_symb_id, lhs_orig_symb_id);
-        else
-          return equation->arg2->getPacTargetSymbId(lhs_symb_id, lhs_orig_symb_id);
+        throw PacTargetNotIdentifiedException{pac_model_name, "No term of the form parameter*(target-LHS_level)"};
       }
-  return -1;
+  throw PacTargetNotIdentifiedException{pac_model_name, "No equation with the corresponding pac_expectation operator"};
 }
 
 void
@@ -4055,7 +4061,16 @@ DynamicModel::addPacModelConsistentExpectationEquation(const string &name, int d
                                                        const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
                                                        ExprNode::subst_table_t &diff_subst_table)
 {
-  int pac_target_symb_id = getPacTargetSymbId(name);
+  int pac_target_symb_id;
+  try
+    {
+      pac_target_symb_id = getPacTargetSymbId(name);
+    }
+  catch (PacTargetNotIdentifiedException &e)
+    {
+      cerr << "Can't identify target for PAC model " << name << ": " << e.message;
+      exit(EXIT_FAILURE);
+    }
   pac_eqtag_and_lag.insert(eqtag_and_lag.begin(), eqtag_and_lag.end());
   int neqs = 0;
   for (auto &it : eqtag_and_lag)
diff --git a/src/DynamicModel.hh b/src/DynamicModel.hh
index 17064c1c36010c201abfff7cd3998bbc604f3410..3cb9941203e438748f291651e7c9285807121021 100644
--- a/src/DynamicModel.hh
+++ b/src/DynamicModel.hh
@@ -508,6 +508,16 @@ public:
   //! Return max lag of pac equation
   void getPacMaxLag(const string &pac_model_name, map<pair<string, string>, pair<string, int>> &eqtag_and_lag) const;
 
+  // Exception thrown by getPacTargetSymbId()
+  class PacTargetNotIdentifiedException
+  {
+  public:
+    const string model_name, message;
+    PacTargetNotIdentifiedException(string model_name_arg, string message_arg) : model_name{move(model_name_arg)}, message{move(message_arg)}
+    {
+    }
+  };
+
   //! Return target of the pac equation
   int getPacTargetSymbId(const string &pac_model_name) const;
 
diff --git a/src/ExprNode.cc b/src/ExprNode.cc
index 8b321d6265e72d6a9a12f3d781e63f4dc628d5e2..4f2095e398cf6c69d23c56a4e7230f223480a5fd 100644
--- a/src/ExprNode.cc
+++ b/src/ExprNode.cc
@@ -573,12 +573,6 @@ NumConstNode::PacMaxLag(int lhs_symb_id) const
   return 0;
 }
 
-int
-NumConstNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  return -1;
-}
-
 expr_t
 NumConstNode::decreaseLeadsLags(int n) const
 {
@@ -1561,12 +1555,6 @@ VariableNode::PacMaxLag(int lhs_symb_id) const
   return 0;
 }
 
-int
-VariableNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  return -1;
-}
-
 expr_t
 VariableNode::substituteAdl() const
 {
@@ -3214,12 +3202,6 @@ UnaryOpNode::PacMaxLag(int lhs_symb_id) const
   return arg->PacMaxLag(lhs_symb_id);
 }
 
-int
-UnaryOpNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  return arg->getPacTargetSymbId(lhs_symb_id, undiff_lhs_symb_id);
-}
-
 expr_t
 UnaryOpNode::substituteAdl() const
 {
@@ -4930,50 +4912,6 @@ BinaryOpNode::PacMaxLag(int lhs_symb_id) const
   return max(arg1->PacMaxLag(lhs_symb_id), arg2->PacMaxLag(lhs_symb_id));
 }
 
-int
-BinaryOpNode::getPacTargetSymbIdHelper(int lhs_symb_id, int undiff_lhs_symb_id, const set<pair<int, int>> &endogs) const
-{
-  int target_symb_id = -1;
-  bool found_lagged_lhs = false;
-  for (auto &it : endogs)
-    {
-      int id = datatree.symbol_table.getUltimateOrigSymbID(it.first);
-      if (id == lhs_symb_id || id == undiff_lhs_symb_id)
-        found_lagged_lhs = true; // This expression contains the (lagged) LHS
-      if (id != lhs_symb_id && id != undiff_lhs_symb_id)
-        /* The first variable that is not the (lagged) LHS is a
-           candidate for the target. FIXME: What happens if there are several
-           such variables? The detection order is not meaningful… */
-        if (target_symb_id < 0)
-          target_symb_id = it.first;
-    }
-  if (!found_lagged_lhs)
-    target_symb_id = -1;
-  return target_symb_id;
-}
-
-int
-BinaryOpNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  set<pair<int, int>> endogs;
-  arg1->collectDynamicVariables(SymbolType::endogenous, endogs);
-  int target_symb_id = getPacTargetSymbIdHelper(lhs_symb_id, undiff_lhs_symb_id, endogs);
-  if (target_symb_id >= 0)
-    return target_symb_id;
-
-  endogs.clear();
-  arg2->collectDynamicVariables(SymbolType::endogenous, endogs);
-  target_symb_id = getPacTargetSymbIdHelper(lhs_symb_id, undiff_lhs_symb_id, endogs);
-
-  if (target_symb_id < 0)
-    {
-      cerr << "Error finding target variable in PAC equation" << endl;
-      exit(EXIT_FAILURE);
-    }
-
-  return target_symb_id;
-}
-
 expr_t
 BinaryOpNode::decreaseLeadsLags(int n) const
 {
@@ -5290,81 +5228,29 @@ BinaryOpNode::findTargetVariable(int lhs_symb_id) const
   return retval;
 }
 
-pair<int, vector<tuple<int, bool, int>>>
-BinaryOpNode::getPacEC(BinaryOpNode *bopn, int lhs_symb_id, int lhs_orig_symb_id) const
-{
-  pair<int, vector<tuple<int, bool, int>>> ec_params_and_vars = {-1, vector<tuple<int, bool, int>>()};
-  int optim_param_symb_id = -1;
-  expr_t optim_part = nullptr;
-  set<pair<int, int>> endogs;
-  bopn->collectDynamicVariables(SymbolType::endogenous, endogs);
-  int target_symb_id = getPacTargetSymbIdHelper(lhs_symb_id, lhs_orig_symb_id, endogs);
-  if (target_symb_id >= 0 && bopn->isParamTimesEndogExpr())
-    {
-      optim_part = bopn->arg2;
-      auto vn = dynamic_cast<VariableNode *>(bopn->arg1);
-      if (!vn || datatree.symbol_table.getType(vn->symb_id) != SymbolType::parameter)
-        {
-          optim_part = bopn->arg1;
-          vn = dynamic_cast<VariableNode *>(bopn->arg2);
-        }
-      if (!vn || datatree.symbol_table.getType(vn->symb_id) != SymbolType::parameter)
-        return ec_params_and_vars;
-      optim_param_symb_id = vn->symb_id;
-    }
-  if (optim_param_symb_id >= 0)
-    {
-      endogs.clear();
-      optim_part->collectDynamicVariables(SymbolType::endogenous, endogs);
-      optim_part->collectDynamicVariables(SymbolType::exogenous, endogs);
-      if (endogs.size() != 2)
-        {
-          cerr << "Error getting EC part of PAC equation" << endl;
-          exit(EXIT_FAILURE);
-        }
-      vector<pair<expr_t, int>> terms;
-      vector<tuple<int, bool, int>> ordered_symb_ids;
-      optim_part->decomposeAdditiveTerms(terms, 1);
-      for (const auto &it : terms)
-        {
-          int scale = it.second;
-          auto vn = dynamic_cast<VariableNode *>(it.first);
-          if (!vn
-              || !(datatree.symbol_table.getType(vn->symb_id) == SymbolType::endogenous
-                   || datatree.symbol_table.getType(vn->symb_id) == SymbolType::exogenous))
-            {
-              cerr << "Problem with error component portion of PAC equation" << endl;
-              exit(EXIT_FAILURE);
-            }
-          int id = vn->symb_id;
-          int orig_id = datatree.symbol_table.getUltimateOrigSymbID(id);
-          bool istarget = true;
-          if (orig_id == lhs_symb_id || orig_id == lhs_orig_symb_id)
-            istarget = false;
-          ordered_symb_ids.emplace_back(id, istarget, scale);
-        }
-      ec_params_and_vars = { optim_param_symb_id, ordered_symb_ids };
-    }
-  return ec_params_and_vars;
-}
-
 void
 BinaryOpNode::getPacAREC(int lhs_symb_id, int lhs_orig_symb_id,
                          pair<int, vector<tuple<int, bool, int>>> &ec_params_and_vars,
                          set<pair<int, pair<int, int>>> &ar_params_and_vars,
                          vector<tuple<int, int, int, double>> &additive_vars_params_and_constants) const
 {
+  ec_params_and_vars.first = -1;
+
   vector<pair<expr_t, int>> terms;
   decomposeAdditiveTerms(terms, 1);
   for (auto it = terms.begin(); it != terms.end(); ++it)
     if (auto bopn = dynamic_cast<BinaryOpNode *>(it->first); bopn)
       {
-        ec_params_and_vars = getPacEC(bopn, lhs_symb_id, lhs_orig_symb_id);
-        if (ec_params_and_vars.first >= 0)
+        try
           {
+            auto [param_id, target_id] = bopn->matchParamTimesTargetMinusVariable(lhs_orig_symb_id);
+            ec_params_and_vars = { param_id, { { target_id, true, 1 }, { lhs_orig_symb_id, false, -1 }}};
             terms.erase(it);
             break;
           }
+        catch (MatchFailureException &e)
+          {
+          }
       }
 
   if (ec_params_and_vars.first < 0)
@@ -5498,26 +5384,26 @@ BinaryOpNode::getPacNonOptimizingPart(BinaryOpNode *bopn, int optim_share) const
 }
 
 pair<int, expr_t>
-BinaryOpNode::getPacOptimizingShareAndExprNodesHelper(BinaryOpNode *bopn, int lhs_symb_id, int lhs_orig_symb_id) const
+BinaryOpNode::getPacOptimizingShareAndExprNodesHelper(int lhs_symb_id, int lhs_orig_symb_id) const
 {
   int optim_param_symb_id = -1;
   expr_t optim_part = nullptr;
-  set<pair<int, int>> endogs;
-  bopn->collectDynamicVariables(SymbolType::endogenous, endogs);
-  int target_symb_id = getPacTargetSymbIdHelper(lhs_symb_id, lhs_orig_symb_id, endogs);
-  if (target_symb_id >= 0)
+  set<int> endogs;
+  collectVariables(SymbolType::endogenous, endogs);
+  // Test whether it contains the LHS in level
+  if (endogs.count(lhs_orig_symb_id) > 0)
     {
       set<int> params;
-      if (bopn->arg1->isParamTimesEndogExpr() && !bopn->arg2->isParamTimesEndogExpr())
+      if (arg1->isParamTimesEndogExpr() && !arg2->isParamTimesEndogExpr())
         {
-          optim_part = bopn->arg1;
-          bopn->arg2->collectVariables(SymbolType::parameter, params);
+          optim_part = arg1;
+          arg2->collectVariables(SymbolType::parameter, params);
           optim_param_symb_id = *(params.begin());
         }
-      else if (bopn->arg2->isParamTimesEndogExpr() && !bopn->arg1->isParamTimesEndogExpr())
+      else if (arg2->isParamTimesEndogExpr() && !arg1->isParamTimesEndogExpr())
         {
-          optim_part = bopn->arg2;
-          bopn->arg1->collectVariables(SymbolType::parameter, params);
+          optim_part = arg2;
+          arg1->collectVariables(SymbolType::parameter, params);
           optim_param_symb_id = *(params.begin());
         }
     }
@@ -5543,7 +5429,7 @@ BinaryOpNode::getPacOptimizingShareAndExprNodes(int lhs_symb_id, int lhs_orig_sy
     if (auto bopn = dynamic_cast<BinaryOpNode *>(it->first); bopn)
       {
         tie(optim_share, optim_part)
-          = getPacOptimizingShareAndExprNodesHelper(bopn, lhs_symb_id, lhs_orig_symb_id);
+          = bopn->getPacOptimizingShareAndExprNodesHelper(lhs_symb_id, lhs_orig_symb_id);
         if (optim_share >= 0 && optim_part)
           {
             terms.erase(it);
@@ -6280,20 +6166,6 @@ TrinaryOpNode::PacMaxLag(int lhs_symb_id) const
   return max(arg1->PacMaxLag(lhs_symb_id), max(arg2->PacMaxLag(lhs_symb_id), arg3->PacMaxLag(lhs_symb_id)));
 }
 
-int
-TrinaryOpNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  int symb_id = arg1->getPacTargetSymbId(lhs_symb_id, undiff_lhs_symb_id);
-  if (symb_id >= 0)
-    return symb_id;
-
-  symb_id = arg2->getPacTargetSymbId(lhs_symb_id, undiff_lhs_symb_id);
-  if (symb_id >= 0)
-    return symb_id;
-
-  return arg3->getPacTargetSymbId(lhs_symb_id, undiff_lhs_symb_id);
-}
-
 expr_t
 TrinaryOpNode::decreaseLeadsLags(int n) const
 {
@@ -6753,19 +6625,6 @@ AbstractExternalFunctionNode::PacMaxLag(int lhs_symb_id) const
   return val;
 }
 
-int
-AbstractExternalFunctionNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  int symb_id = -1;
-  for (auto argument : arguments)
-    {
-      symb_id = argument->getPacTargetSymbId(lhs_symb_id, undiff_lhs_symb_id);
-      if (symb_id >= 0)
-        return symb_id;
-    }
-  return -1;
-}
-
 expr_t
 AbstractExternalFunctionNode::decreaseLeadsLags(int n) const
 {
@@ -8355,12 +8214,6 @@ VarExpectationNode::PacMaxLag(int lhs_symb_id) const
   exit(EXIT_FAILURE);
 }
 
-int
-VarExpectationNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  return -1;
-}
-
 expr_t
 VarExpectationNode::decreaseLeadsLags(int n) const
 {
@@ -8779,12 +8632,6 @@ PacExpectationNode::PacMaxLag(int lhs_symb_id) const
   return 0;
 }
 
-int
-PacExpectationNode::getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const
-{
-  return -1;
-}
-
 expr_t
 PacExpectationNode::decreaseLeadsLags(int n) const
 {
@@ -9219,3 +9066,38 @@ ExprNode::matchParamTimesLinearCombinationOfVariables() const
 
   return { dynamic_cast<VariableNode *>(param)->symb_id, lincomb->matchLinearCombinationOfVariables() };
 }
+
+pair<int, int>
+ExprNode::matchParamTimesTargetMinusVariable(int symb_id) const
+{
+  auto bopn = dynamic_cast<const BinaryOpNode *>(this);
+  if (!bopn || bopn->op_code != BinaryOpcode::times)
+    throw MatchFailureException{"Not a multiplicative expression"};
+
+  expr_t param = bopn->arg1, minus = bopn->arg2;
+
+  auto is_param = [](expr_t e) {
+                    auto vn = dynamic_cast<VariableNode *>(e);
+                    return vn && vn->get_type() == SymbolType::parameter;
+                  };
+
+  if (!is_param(param))
+    {
+      swap(param, minus);
+      if (!is_param(param))
+        throw MatchFailureException{"No parameter on either side of the multiplication"};
+    }
+
+  auto bminus = dynamic_cast<const BinaryOpNode *>(minus);
+  if (!bminus || bminus->op_code != BinaryOpcode::minus)
+    throw MatchFailureException{"Neither factor is a minus operator"};
+
+  auto lhs_level = dynamic_cast<const VariableNode *>(bminus->arg2);
+  auto target = dynamic_cast<const VariableNode *>(bminus->arg1);
+  if (lhs_level && lhs_level->symb_id == symb_id && target
+      && (target->get_type() == SymbolType::endogenous
+          || target->get_type() == SymbolType::exogenous))
+    return { dynamic_cast<VariableNode *>(param)->symb_id, target->symb_id };
+  else
+    throw MatchFailureException{"Neither factor is of the form (target-variable) where target is endo or exo"};
+}
diff --git a/src/ExprNode.hh b/src/ExprNode.hh
index 25909fff6114ddfd37a51352291391d92921bf6e..e44092163afa7cdf413723185c24c5eb4e263b8a 100644
--- a/src/ExprNode.hh
+++ b/src/ExprNode.hh
@@ -479,12 +479,6 @@ public:
   //! Takes account of undiffed LHS variables in calculating the max lag
   virtual int PacMaxLag(int lhs_symb_id) const = 0;
 
-  //! Get the target variable of the PAC model
-  /* The algorithm is rather crude. For a BinaryOpNode, it inspects both
-     arguments. If one of the argument contains the (lagged) LHS, the first
-     variable that is not the (lagged) LHS is returned as the target */
-  virtual int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const = 0;
-
   virtual expr_t undiff() const = 0;
 
   //! Returns a new expression where all the leads/lags have been shifted backwards by the same amount
@@ -663,6 +657,13 @@ public:
 
   pair<int, vector<tuple<int, int, int, double>>> matchParamTimesLinearCombinationOfVariables() const;
 
+  /* Matches an expression of the form parameter*(var1-endo2).
+     endo2 must correspond to symb_id. var1 must be an endogenous or an
+     exogenous.
+     Returns the symbol IDs of the parameter and of var1.
+     Throws a MatchFailureException otherwise */
+  pair<int, int> matchParamTimesTargetMinusVariable(int symb_id) const;
+
   //! Returns true if expression is of the form:
   //! param * (endog op endog op ...) + param * (endog op endog op ...) + ...
   virtual bool isParamTimesEndogExpr() const = 0;
@@ -766,7 +767,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const override;
@@ -843,7 +843,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const override;
@@ -947,7 +946,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const override;
@@ -1058,8 +1056,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbIdHelper(int lhs_symb_id, int undiff_lhs_symb_id, const set<pair<int, int>> &endogs) const;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const override;
@@ -1101,7 +1097,14 @@ public:
   void findConstantEquations(map<VariableNode *, NumConstNode *> &table) const override;
   expr_t replaceVarsInEquation(map<VariableNode *, NumConstNode *> &table) const override;
   bool containsPacExpectation(const string &pac_model_name = "") const override;
-  pair<int, vector<tuple<int, bool, int>>> getPacEC(BinaryOpNode *bopn, int lhs_symb_id, int lhs_orig_symb_id) const;
+  /*
+    ec_params_and_vars:
+    - 1st element = feedback force parameter
+    - 2nd element = list of terms in the cointegration relationship (symb_id,
+      is target ?, multiplicative scalar); this form theoretically allows for a
+      linear combination in the cointegration, though for the time being we allow
+      less than that
+   */
   void getPacAREC(int lhs_symb_id, int lhs_orig_symb_id,
                   pair<int, vector<tuple<int, bool, int>>> &ec_params_and_vars,
                   set<pair<int, pair<int, int>>> &ar_params_and_vars,
@@ -1111,7 +1114,7 @@ public:
   //! the expr node associated with it,
   //! and the expr node associated with the non-optimizing part
   tuple<int, expr_t, expr_t, expr_t> getPacOptimizingShareAndExprNodes(int lhs_symb_id, int lhs_orig_symb_id) const;
-  pair<int, expr_t> getPacOptimizingShareAndExprNodesHelper(BinaryOpNode *bopn, int lhs_symb_id, int lhs_orig_symb_id) const;
+  pair<int, expr_t> getPacOptimizingShareAndExprNodesHelper(int lhs_symb_id, int lhs_orig_symb_id) const;
   expr_t getPacNonOptimizingPart(BinaryOpNode *bopn, int optim_share) const;
   bool getPacNonOptimizingPartHelper(BinaryOpNode *bopn, int optim_share) const;
   bool isParamTimesEndogExpr() const override;
@@ -1185,7 +1188,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const override;
@@ -1301,7 +1303,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const override;
@@ -1476,7 +1477,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   void prepareForDerivation() override;
@@ -1553,7 +1553,6 @@ public:
   int VarMinLag() const override;
   int VarMaxLag(const set<expr_t> &lhs_lag_equiv) const override;
   int PacMaxLag(int lhs_symb_id) const override;
-  int getPacTargetSymbId(int lhs_symb_id, int undiff_lhs_symb_id) const override;
   expr_t undiff() const override;
   expr_t decreaseLeadsLags(int n) const override;
   void prepareForDerivation() override;