diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index ff8e451..89ce166 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -154,7 +154,7 @@
   }
 
   // cancel unsatisfy & straggler timer
-  this->cancelUnsatisfyAndStragglerTimer(pitEntry);
+  this->cancelUnsatisfyAndStragglerTimer(*pitEntry);
 
   // is pending?
   if (!pitEntry->hasInRecords()) {
@@ -190,8 +190,7 @@
 }
 
 void
-Forwarder::onContentStoreMiss(const Face& inFace,
-                              shared_ptr<pit::Entry> pitEntry,
+Forwarder::onContentStoreMiss(const Face& inFace, const shared_ptr<pit::Entry>& pitEntry,
                               const Interest& interest)
 {
   NFD_LOG_DEBUG("onContentStoreMiss interest=" << interest.getName());
@@ -203,15 +202,13 @@
   this->setUnsatisfyTimer(pitEntry);
 
   // dispatch to strategy: after incoming Interest
-  this->dispatchToStrategy(pitEntry,
-    [&] (fw::Strategy* strategy) { strategy->afterReceiveInterest(inFace, interest, pitEntry); });
+  this->dispatchToStrategy(*pitEntry,
+    [&] (fw::Strategy& strategy) { strategy.afterReceiveInterest(inFace, interest, pitEntry); });
 }
 
 void
-Forwarder::onContentStoreHit(const Face& inFace,
-                             shared_ptr<pit::Entry> pitEntry,
-                             const Interest& interest,
-                             const Data& data)
+Forwarder::onContentStoreHit(const Face& inFace, const shared_ptr<pit::Entry>& pitEntry,
+                             const Interest& interest, const Data& data)
 {
   NFD_LOG_DEBUG("onContentStoreHit interest=" << interest.getName());
 
@@ -226,7 +223,7 @@
 }
 
 void
-Forwarder::onOutgoingInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace,
+Forwarder::onOutgoingInterest(const shared_ptr<pit::Entry>& pitEntry, Face& outFace,
                               bool wantNewNonce)
 {
   if (outFace.getId() == face::INVALID_FACEID) {
@@ -274,7 +271,7 @@
 }
 
 void
-Forwarder::onInterestReject(shared_ptr<pit::Entry> pitEntry)
+Forwarder::onInterestReject(const shared_ptr<pit::Entry>& pitEntry)
 {
   if (fw::hasPendingOutRecords(*pitEntry)) {
     NFD_LOG_ERROR("onInterestReject interest=" << pitEntry->getName() <<
@@ -284,28 +281,28 @@
   NFD_LOG_DEBUG("onInterestReject interest=" << pitEntry->getName());
 
   // cancel unsatisfy & straggler timer
-  this->cancelUnsatisfyAndStragglerTimer(pitEntry);
+  this->cancelUnsatisfyAndStragglerTimer(*pitEntry);
 
   // set PIT straggler timer
   this->setStragglerTimer(pitEntry, false);
 }
 
 void
-Forwarder::onInterestUnsatisfied(shared_ptr<pit::Entry> pitEntry)
+Forwarder::onInterestUnsatisfied(const shared_ptr<pit::Entry>& pitEntry)
 {
   NFD_LOG_DEBUG("onInterestUnsatisfied interest=" << pitEntry->getName());
 
   // invoke PIT unsatisfied callback
-  this->dispatchToStrategy(pitEntry,
-    [&] (fw::Strategy* strategy) { strategy->beforeExpirePendingInterest(pitEntry); });
+  this->dispatchToStrategy(*pitEntry,
+    [&] (fw::Strategy& strategy) { strategy.beforeExpirePendingInterest(pitEntry); });
 
   // goto Interest Finalize pipeline
   this->onInterestFinalize(pitEntry, false);
 }
 
 void
-Forwarder::onInterestFinalize(shared_ptr<pit::Entry> pitEntry, bool isSatisfied,
-                              const time::milliseconds& dataFreshnessPeriod)
+Forwarder::onInterestFinalize(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
+                              time::milliseconds dataFreshnessPeriod)
 {
   NFD_LOG_DEBUG("onInterestFinalize interest=" << pitEntry->getName() <<
                 (isSatisfied ? " satisfied" : " unsatisfied"));
@@ -314,7 +311,7 @@
   this->insertDeadNonceList(*pitEntry, isSatisfied, dataFreshnessPeriod, 0);
 
   // PIT delete
-  this->cancelUnsatisfyAndStragglerTimer(pitEntry);
+  this->cancelUnsatisfyAndStragglerTimer(*pitEntry);
   m_pit.erase(pitEntry);
 }
 
@@ -354,7 +351,7 @@
     NFD_LOG_DEBUG("onIncomingData matching=" << pitEntry->getName());
 
     // cancel unsatisfy & straggler timer
-    this->cancelUnsatisfyAndStragglerTimer(pitEntry);
+    this->cancelUnsatisfyAndStragglerTimer(*pitEntry);
 
     // remember pending downstreams
     for (const pit::InRecord& inRecord : pitEntry->getInRecords()) {
@@ -364,8 +361,8 @@
     }
 
     // invoke PIT satisfy callback
-    this->dispatchToStrategy(pitEntry,
-      [&] (fw::Strategy* strategy) { strategy->beforeSatisfyInterest(pitEntry, inFace, data); });
+    this->dispatchToStrategy(*pitEntry,
+      [&] (fw::Strategy& strategy) { strategy.beforeSatisfyInterest(pitEntry, inFace, data); });
 
     // Dead Nonce List insert if necessary (for out-record of inFace)
     this->insertDeadNonceList(*pitEntry, true, data.getFreshnessPeriod(), &inFace);
@@ -481,12 +478,12 @@
   outRecord->setIncomingNack(nack);
 
   // trigger strategy: after receive NACK
-  this->dispatchToStrategy(pitEntry,
-    [&] (fw::Strategy* strategy) { strategy->afterReceiveNack(inFace, nack, pitEntry); });
+  this->dispatchToStrategy(*pitEntry,
+    [&] (fw::Strategy& strategy) { strategy.afterReceiveNack(inFace, nack, pitEntry); });
 }
 
 void
-Forwarder::onOutgoingNack(shared_ptr<pit::Entry> pitEntry, const Face& outFace,
+Forwarder::onOutgoingNack(const shared_ptr<pit::Entry>& pitEntry, const Face& outFace,
                           const lp::NackHeader& nack)
 {
   if (outFace.getId() == face::INVALID_FACEID) {
@@ -598,7 +595,7 @@
 }
 
 void
-Forwarder::setUnsatisfyTimer(shared_ptr<pit::Entry> pitEntry)
+Forwarder::setUnsatisfyTimer(const shared_ptr<pit::Entry>& pitEntry)
 {
   pit::InRecordCollection::iterator lastExpiring =
     std::max_element(pitEntry->in_begin(), pitEntry->in_end(), &compare_InRecord_expiry);
@@ -615,8 +612,8 @@
 }
 
 void
-Forwarder::setStragglerTimer(shared_ptr<pit::Entry> pitEntry, bool isSatisfied,
-                             const time::milliseconds& dataFreshnessPeriod)
+Forwarder::setStragglerTimer(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
+                             time::milliseconds dataFreshnessPeriod)
 {
   time::nanoseconds stragglerTime = time::milliseconds(100);
 
@@ -626,10 +623,10 @@
 }
 
 void
-Forwarder::cancelUnsatisfyAndStragglerTimer(shared_ptr<pit::Entry> pitEntry)
+Forwarder::cancelUnsatisfyAndStragglerTimer(pit::Entry& pitEntry)
 {
-  scheduler::cancel(pitEntry->m_unsatisfyTimer);
-  scheduler::cancel(pitEntry->m_stragglerTimer);
+  scheduler::cancel(pitEntry.m_unsatisfyTimer);
+  scheduler::cancel(pitEntry.m_stragglerTimer);
 }
 
 static inline void
@@ -641,8 +638,7 @@
 
 void
 Forwarder::insertDeadNonceList(pit::Entry& pitEntry, bool isSatisfied,
-                               const time::milliseconds& dataFreshnessPeriod,
-                               Face* upstream)
+                               time::milliseconds dataFreshnessPeriod, Face* upstream)
 {
   // need Dead Nonce List insert?
   bool needDnl = false;
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index b561d6f..855c24e 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -57,25 +57,37 @@
   ~Forwarder();
 
   const ForwarderCounters&
-  getCounters() const;
+  getCounters() const
+  {
+    return m_counters;
+  }
 
 public: // faces
   FaceTable&
-  getFaceTable();
+  getFaceTable()
+  {
+    return m_faceTable;
+  }
 
   /** \brief get existing Face
    *
    *  shortcut to .getFaceTable().get(face)
    */
   Face*
-  getFace(FaceId id) const;
+  getFace(FaceId id) const
+  {
+    return m_faceTable.get(id);
+  }
 
   /** \brief add new Face
    *
    *  shortcut to .getFaceTable().add(face)
    */
   void
-  addFace(shared_ptr<Face> face);
+  addFace(shared_ptr<Face> face)
+  {
+    m_faceTable.add(face);
+  }
 
 public: // forwarding entrypoints and tables
   /** \brief start incoming Interest processing
@@ -100,28 +112,52 @@
   startProcessNack(Face& face, const lp::Nack& nack);
 
   NameTree&
-  getNameTree();
+  getNameTree()
+  {
+    return m_nameTree;
+  }
 
   Fib&
-  getFib();
+  getFib()
+  {
+    return m_fib;
+  }
 
   Pit&
-  getPit();
+  getPit()
+  {
+    return m_pit;
+  }
 
   Cs&
-  getCs();
+  getCs()
+  {
+    return m_cs;
+  }
 
   Measurements&
-  getMeasurements();
+  getMeasurements()
+  {
+    return m_measurements;
+  }
 
   StrategyChoice&
-  getStrategyChoice();
+  getStrategyChoice()
+  {
+    return m_strategyChoice;
+  }
 
   DeadNonceList&
-  getDeadNonceList();
+  getDeadNonceList()
+  {
+    return m_deadNonceList;
+  }
 
   NetworkRegionTable&
-  getNetworkRegionTable();
+  getNetworkRegionTable()
+  {
+    return m_networkRegionTable;
+  }
 
   /** \brief performs a FIB lookup, considering Link object if present
    */
@@ -142,37 +178,38 @@
   /** \brief Content Store miss pipeline
   */
   VIRTUAL_WITH_TESTS void
-  onContentStoreMiss(const Face& inFace, shared_ptr<pit::Entry> pitEntry, const Interest& interest);
+  onContentStoreMiss(const Face& inFace, const shared_ptr<pit::Entry>& pitEntry,
+                     const Interest& interest);
 
   /** \brief Content Store hit pipeline
   */
   VIRTUAL_WITH_TESTS void
-  onContentStoreHit(const Face& inFace, shared_ptr<pit::Entry> pitEntry,
+  onContentStoreHit(const Face& inFace, const shared_ptr<pit::Entry>& pitEntry,
                     const Interest& interest, const Data& data);
 
   /** \brief outgoing Interest pipeline
    */
   VIRTUAL_WITH_TESTS void
-  onOutgoingInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace,
+  onOutgoingInterest(const shared_ptr<pit::Entry>& pitEntry, Face& outFace,
                      bool wantNewNonce = false);
 
   /** \brief Interest reject pipeline
    */
   VIRTUAL_WITH_TESTS void
-  onInterestReject(shared_ptr<pit::Entry> pitEntry);
+  onInterestReject(const shared_ptr<pit::Entry>& pitEntry);
 
   /** \brief Interest unsatisfied pipeline
    */
   VIRTUAL_WITH_TESTS void
-  onInterestUnsatisfied(shared_ptr<pit::Entry> pitEntry);
+  onInterestUnsatisfied(const shared_ptr<pit::Entry>& pitEntry);
 
   /** \brief Interest finalize pipeline
    *  \param isSatisfied whether the Interest has been satisfied
    *  \param dataFreshnessPeriod FreshnessPeriod of satisfying Data
    */
   VIRTUAL_WITH_TESTS void
-  onInterestFinalize(shared_ptr<pit::Entry> pitEntry, bool isSatisfied,
-                     const time::milliseconds& dataFreshnessPeriod = time::milliseconds(-1));
+  onInterestFinalize(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
+                     time::milliseconds dataFreshnessPeriod = time::milliseconds(-1));
 
   /** \brief incoming Data pipeline
    */
@@ -197,18 +234,18 @@
   /** \brief outgoing Nack pipeline
    */
   VIRTUAL_WITH_TESTS void
-  onOutgoingNack(shared_ptr<pit::Entry> pitEntry, const Face& outFace, const lp::NackHeader& nack);
+  onOutgoingNack(const shared_ptr<pit::Entry>& pitEntry, const Face& outFace, const lp::NackHeader& nack);
 
 PROTECTED_WITH_TESTS_ELSE_PRIVATE:
   VIRTUAL_WITH_TESTS void
-  setUnsatisfyTimer(shared_ptr<pit::Entry> pitEntry);
+  setUnsatisfyTimer(const shared_ptr<pit::Entry>& pitEntry);
 
   VIRTUAL_WITH_TESTS void
-  setStragglerTimer(shared_ptr<pit::Entry> pitEntry, bool isSatisfied,
-                    const time::milliseconds& dataFreshnessPeriod = time::milliseconds(-1));
+  setStragglerTimer(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
+                    time::milliseconds dataFreshnessPeriod = time::milliseconds(-1));
 
   VIRTUAL_WITH_TESTS void
-  cancelUnsatisfyAndStragglerTimer(shared_ptr<pit::Entry> pitEntry);
+  cancelUnsatisfyAndStragglerTimer(pit::Entry& pitEntry);
 
   /** \brief insert Nonce to Dead Nonce List if necessary
    *  \param upstream if null, insert Nonces from all out-records;
@@ -216,18 +253,21 @@
    */
   VIRTUAL_WITH_TESTS void
   insertDeadNonceList(pit::Entry& pitEntry, bool isSatisfied,
-                      const time::milliseconds& dataFreshnessPeriod,
-                      Face* upstream);
+                      time::milliseconds dataFreshnessPeriod, Face* upstream);
 
-  /// call trigger (method) on the effective strategy of pitEntry
+  /** \brief call trigger (method) on the effective strategy of pitEntry
+   */
 #ifdef WITH_TESTS
   virtual void
-  dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, function<void(fw::Strategy*)> trigger);
+  dispatchToStrategy(pit::Entry& pitEntry, function<void(fw::Strategy&)> trigger)
 #else
   template<class Function>
   void
-  dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, Function trigger);
+  dispatchToStrategy(pit::Entry& pitEntry, Function trigger)
 #endif
+  {
+    trigger(m_strategyChoice.findEffectiveStrategy(pitEntry));
+  }
 
 private:
   ForwarderCounters m_counters;
@@ -248,91 +288,6 @@
   friend class fw::Strategy;
 };
 
-inline const ForwarderCounters&
-Forwarder::getCounters() const
-{
-  return m_counters;
-}
-
-inline FaceTable&
-Forwarder::getFaceTable()
-{
-  return m_faceTable;
-}
-
-inline Face*
-Forwarder::getFace(FaceId id) const
-{
-  return m_faceTable.get(id);
-}
-
-inline void
-Forwarder::addFace(shared_ptr<Face> face)
-{
-  m_faceTable.add(face);
-}
-
-inline NameTree&
-Forwarder::getNameTree()
-{
-  return m_nameTree;
-}
-
-inline Fib&
-Forwarder::getFib()
-{
-  return m_fib;
-}
-
-inline Pit&
-Forwarder::getPit()
-{
-  return m_pit;
-}
-
-inline Cs&
-Forwarder::getCs()
-{
-  return m_cs;
-}
-
-inline Measurements&
-Forwarder::getMeasurements()
-{
-  return m_measurements;
-}
-
-inline StrategyChoice&
-Forwarder::getStrategyChoice()
-{
-  return m_strategyChoice;
-}
-
-inline DeadNonceList&
-Forwarder::getDeadNonceList()
-{
-  return m_deadNonceList;
-}
-
-inline NetworkRegionTable&
-Forwarder::getNetworkRegionTable()
-{
-  return m_networkRegionTable;
-}
-
-#ifdef WITH_TESTS
-inline void
-Forwarder::dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, function<void(fw::Strategy*)> trigger)
-#else
-template<class Function>
-inline void
-Forwarder::dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, Function trigger)
-#endif
-{
-  fw::Strategy& strategy = m_strategyChoice.findEffectiveStrategy(*pitEntry);
-  trigger(&strategy);
-}
-
 } // namespace nfd
 
 #endif // NFD_DAEMON_FW_FORWARDER_HPP
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 53b8935..7e668b6 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -66,7 +66,7 @@
 }
 
 void
-Strategy::sendNacks(shared_ptr<pit::Entry> pitEntry, const lp::NackHeader& header,
+Strategy::sendNacks(const shared_ptr<pit::Entry>& pitEntry, const lp::NackHeader& header,
                     std::initializer_list<const Face*> exceptFaces)
 {
   // populate downstreams with all downstreams faces
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 4f3da2c..5cea6a6 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -50,9 +50,13 @@
   virtual
   ~Strategy();
 
-  /// a Name that represent the Strategy program
+  /** \return a Name that represents the strategy program
+   */
   const Name&
-  getName() const;
+  getName() const
+  {
+    return m_name;
+  }
 
 public: // triggers
   /** \brief trigger after Interest is received
@@ -131,8 +135,11 @@
    *                      rather than reusing a Nonce from one of the PIT in-records
    */
   VIRTUAL_WITH_TESTS void
-  sendInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace,
-               bool wantNewNonce = false);
+  sendInterest(const shared_ptr<pit::Entry>& pitEntry, Face& outFace,
+               bool wantNewNonce = false)
+  {
+    m_forwarder.onOutgoingInterest(pitEntry, outFace, wantNewNonce);
+  }
 
   /** \brief decide that a pending Interest cannot be forwarded
    *  \param pitEntry PIT entry
@@ -141,7 +148,10 @@
    *  forwarded earlier, and does not need to be resent now.
    */
   VIRTUAL_WITH_TESTS void
-  rejectPendingInterest(shared_ptr<pit::Entry> pitEntry);
+  rejectPendingInterest(const shared_ptr<pit::Entry>& pitEntry)
+  {
+    m_forwarder.onInterestReject(pitEntry);
+  }
 
   /** \brief send Nack to outFace
    *  \param pitEntry PIT entry
@@ -151,8 +161,11 @@
    *  The outFace must have a PIT in-record, otherwise this method has no effect.
    */
   VIRTUAL_WITH_TESTS void
-  sendNack(shared_ptr<pit::Entry> pitEntry, const Face& outFace,
-           const lp::NackHeader& header);
+  sendNack(const shared_ptr<pit::Entry>& pitEntry, const Face& outFace,
+           const lp::NackHeader& header)
+  {
+    m_forwarder.onOutgoingNack(pitEntry, outFace, header);
+  }
 
   /** \brief send Nack to every face that has an in-record,
    *         except those in \p exceptFaces
@@ -162,21 +175,33 @@
    *  \note This is not an action, but a helper that invokes the sendNack action.
    */
   void
-  sendNacks(shared_ptr<pit::Entry> pitEntry, const lp::NackHeader& header,
+  sendNacks(const shared_ptr<pit::Entry>& pitEntry, const lp::NackHeader& header,
             std::initializer_list<const Face*> exceptFaces = std::initializer_list<const Face*>());
 
 protected: // accessors
   const fib::Entry&
-  lookupFib(const pit::Entry& pitEntry);
+  lookupFib(const pit::Entry& pitEntry)
+  {
+    return m_forwarder.lookupFib(pitEntry);
+  }
 
   MeasurementsAccessor&
-  getMeasurements();
+  getMeasurements()
+  {
+    return m_measurements;
+  }
 
   Face*
-  getFace(FaceId id) const;
+  getFace(FaceId id) const
+  {
+    return m_forwarder.getFace(id);
+  }
 
   const FaceTable&
-  getFaceTable() const;
+  getFaceTable() const
+  {
+    return m_forwarder.getFaceTable();
+  }
 
 protected: // accessors
   signal::Signal<FaceTable, Face&>& afterAddFace;
@@ -194,55 +219,6 @@
   MeasurementsAccessor m_measurements;
 };
 
-inline const Name&
-Strategy::getName() const
-{
-  return m_name;
-}
-
-inline void
-Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace, bool wantNewNonce)
-{
-  m_forwarder.onOutgoingInterest(pitEntry, outFace, wantNewNonce);
-}
-
-inline void
-Strategy::rejectPendingInterest(shared_ptr<pit::Entry> pitEntry)
-{
-  m_forwarder.onInterestReject(pitEntry);
-}
-
-inline void
-Strategy::sendNack(shared_ptr<pit::Entry> pitEntry, const Face& outFace,
-                   const lp::NackHeader& header)
-{
-  m_forwarder.onOutgoingNack(pitEntry, outFace, header);
-}
-
-inline const fib::Entry&
-Strategy::lookupFib(const pit::Entry& pitEntry)
-{
-  return m_forwarder.lookupFib(pitEntry);
-}
-
-inline MeasurementsAccessor&
-Strategy::getMeasurements()
-{
-  return m_measurements;
-}
-
-inline Face*
-Strategy::getFace(FaceId id) const
-{
-  return m_forwarder.getFace(id);
-}
-
-inline const FaceTable&
-Strategy::getFaceTable() const
-{
-  return m_forwarder.getFaceTable();
-}
-
 } // namespace fw
 } // namespace nfd
 
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 0e6741c..b771129 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -184,7 +184,7 @@
 
 protected:
   virtual void
-  dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, function<void(fw::Strategy*)> f) override
+  dispatchToStrategy(pit::Entry& pitEntry, function<void(fw::Strategy&)> trigger) override
   {
     ++dispatchToStrategy_count;
   }
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index 3840438..3a2384f 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -52,16 +52,33 @@
 
 protected:
   virtual void
-  sendInterest(shared_ptr<pit::Entry> pitEntry,
+  sendInterest(const shared_ptr<pit::Entry>& pitEntry,
                Face& outFace,
-               bool wantNewNonce = false) override;
+               bool wantNewNonce = false) override
+  {
+    SendInterestArgs args{pitEntry, outFace.getId(), wantNewNonce};
+    sendInterestHistory.push_back(args);
+    pitEntry->insertOrUpdateOutRecord(outFace, pitEntry->getInterest());
+    afterAction();
+  }
 
   virtual void
-  rejectPendingInterest(shared_ptr<pit::Entry> pitEntry) override;
+  rejectPendingInterest(const shared_ptr<pit::Entry>& pitEntry) override
+  {
+    RejectPendingInterestArgs args{pitEntry};
+    rejectPendingInterestHistory.push_back(args);
+    afterAction();
+  }
 
   virtual void
-  sendNack(shared_ptr<pit::Entry> pitEntry, const Face& outFace,
-           const lp::NackHeader& header) override;
+  sendNack(const shared_ptr<pit::Entry>& pitEntry, const Face& outFace,
+           const lp::NackHeader& header) override
+  {
+    SendNackArgs args{pitEntry, outFace.getId(), header};
+    sendNackHistory.push_back(args);
+    pitEntry->deleteInRecord(outFace);
+    afterAction();
+  }
 
 public:
   struct SendInterestArgs
@@ -87,39 +104,6 @@
   std::vector<SendNackArgs> sendNackHistory;
 };
 
-
-template<typename S>
-inline void
-StrategyTester<S>::sendInterest(shared_ptr<pit::Entry> pitEntry,
-                                Face& outFace,
-                                bool wantNewNonce)
-{
-  SendInterestArgs args{pitEntry, outFace.getId(), wantNewNonce};
-  sendInterestHistory.push_back(args);
-  pitEntry->insertOrUpdateOutRecord(outFace, pitEntry->getInterest());
-  afterAction();
-}
-
-template<typename S>
-inline void
-StrategyTester<S>::rejectPendingInterest(shared_ptr<pit::Entry> pitEntry)
-{
-  RejectPendingInterestArgs args{pitEntry};
-  rejectPendingInterestHistory.push_back(args);
-  afterAction();
-}
-
-template<typename S>
-inline void
-StrategyTester<S>::sendNack(shared_ptr<pit::Entry> pitEntry, const Face& outFace,
-                            const lp::NackHeader& header)
-{
-  SendNackArgs args{pitEntry, outFace.getId(), header};
-  sendNackHistory.push_back(args);
-  pitEntry->deleteInRecord(outFace);
-  afterAction();
-}
-
 } // namespace tests
 } // namespace fw
 } // namespace nfd
