diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index 9d4df0c..a7eed83 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -136,7 +136,7 @@
   this->sendInterest(pitEntry, *face);
 
   // schedule RTO timeout
-  shared_ptr<PitInfo> pi = pitEntry->getOrCreateStrategyInfo<PitInfo>();
+  shared_ptr<PitInfo> pi = pitEntry->insertStrategyInfo<PitInfo>();
   pi->rtoTimer = scheduler::schedule(rto,
       bind(&AccessStrategy::afterRtoTimeout, this, weak_ptr<pit::Entry>(pitEntry),
            inFace.getId(), mi.lastNexthop));
@@ -229,14 +229,14 @@
 {
   measurements::Entry* me = this->getMeasurements().findLongestPrefixMatch(pitEntry);
   if (me == nullptr) {
-    return std::forward_as_tuple(Name(), nullptr);
+    return std::make_tuple(Name(), nullptr);
   }
 
   shared_ptr<MtInfo> mi = me->getStrategyInfo<MtInfo>();
   BOOST_ASSERT(mi != nullptr);
   // XXX after runtime strategy change, it's possible that me exists but mi doesn't exist;
   // this case needs another longest prefix match until mi is found
-  return std::forward_as_tuple(me->getName(), mi);
+  return std::make_tuple(me->getName(), mi);
 }
 
 shared_ptr<AccessStrategy::MtInfo>
@@ -255,7 +255,7 @@
   static const time::nanoseconds ME_LIFETIME = time::seconds(8);
   this->getMeasurements().extendLifetime(*me, ME_LIFETIME);
 
-  return me->getOrCreateStrategyInfo<MtInfo>();
+  return me->insertStrategyInfo<MtInfo>();
 }
 
 AccessStrategy::FaceInfo::FaceInfo()
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index c15aca0..c7f68c9 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -228,7 +228,7 @@
   // Set or update entry lifetime
   extendLifetime(*me);
 
-  shared_ptr<NamespaceInfo> info = me->getOrCreateStrategyInfo<NamespaceInfo>();
+  shared_ptr<NamespaceInfo> info = me->insertStrategyInfo<NamespaceInfo>();
   BOOST_ASSERT(info != nullptr);
 
   return info;
@@ -252,7 +252,7 @@
   // Set or update entry lifetime
   extendLifetime(*me);
 
-  shared_ptr<NamespaceInfo> info = me->getOrCreateStrategyInfo<NamespaceInfo>();
+  shared_ptr<NamespaceInfo> info = me->insertStrategyInfo<NamespaceInfo>();
   BOOST_ASSERT(info != nullptr);
 
   return *info;
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index b127fea..c56eef4 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -54,7 +54,7 @@
     return;
   }
 
-  shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getOrCreateStrategyInfo<PitEntryInfo>();
+  shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->insertStrategyInfo<PitEntryInfo>();
   bool isNewPitEntry = !hasPendingOutRecords(*pitEntry);
   if (!isNewPitEntry) {
     return;
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index 3cca0ab..5edff29 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.cpp
@@ -82,7 +82,7 @@
   time::steady_clock::TimePoint now = time::steady_clock::now();
   time::steady_clock::Duration sinceLastOutgoing = now - lastOutgoing;
 
-  shared_ptr<PitInfo> pi = pitEntry.getOrCreateStrategyInfo<PitInfo>(m_initialInterval);
+  shared_ptr<PitInfo> pi = pitEntry.insertStrategyInfo<PitInfo>(m_initialInterval);
   bool shouldSuppress = sinceLastOutgoing < pi->suppressionInterval;
 
   if (shouldSuppress) {
diff --git a/daemon/fw/strategy-info.hpp b/daemon/fw/strategy-info.hpp
index 133d53c..aae3862 100644
--- a/daemon/fw/strategy-info.hpp
+++ b/daemon/fw/strategy-info.hpp
@@ -38,7 +38,7 @@
 public:
 #ifdef DOXYGEN
   /** \return an integer that uniquely identifies this StrategyInfo type
-   *  \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyInfoType
+   *  \sa https://redmine.named-data.net/projects/nfd/wiki/StrategyInfoType
    */
   static constexpr int
   getTypeId()
@@ -48,15 +48,12 @@
 #endif
 
   virtual
-  ~StrategyInfo();
+  ~StrategyInfo() = default;
+
+protected:
+  StrategyInfo() = default;
 };
 
-
-inline
-StrategyInfo::~StrategyInfo()
-{
-}
-
 } // namespace fw
 } // namespace nfd
 
