diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index b82ba40..6ae2767 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -36,7 +36,8 @@
 
 AccessStrategy::AccessStrategy(Forwarder& forwarder, const Name& name)
   : Strategy(forwarder)
-  , m_removeFaceInfoConn(beforeRemoveFace.connect([this] (const Face& face) { removeFaceInfo(face); }))
+  , m_rttEstimatorOpts(make_shared<RttEstimator::Options>()) // use the default options
+  , m_removeFaceConn(beforeRemoveFace.connect([this] (const Face& face) { m_fit.erase(face.getId()); }))
 {
   ParsedInstanceName parsed = parseInstanceName(name);
   if (!parsed.parameters.empty()) {
@@ -139,7 +140,7 @@
     return false;
   }
 
-  auto rto = mi.rtt.computeRto();
+  auto rto = mi.rtt.getEstimatedRto();
   NFD_LOG_DEBUG(pitEntry->getInterest() << " interestTo " << mi.lastNexthop
                 << " last-nexthop rto=" << time::duration_cast<time::microseconds>(rto).count());
 
@@ -147,10 +148,11 @@
 
   // schedule RTO timeout
   PitInfo* pi = pitEntry->insertStrategyInfo<PitInfo>().first;
-  pi->rtoTimer = getScheduler().schedule(rto, [=] {
-    afterRtoTimeout(weak_ptr<pit::Entry>(pitEntry),
-                    ingress.face.getId(), ingress.endpoint, mi.lastNexthop);
-  });
+  pi->rtoTimer = getScheduler().schedule(rto,
+    [this, pitWeak = weak_ptr<pit::Entry>(pitEntry), face = ingress.face.getId(),
+     endpoint = ingress.endpoint, lastNexthop = mi.lastNexthop] {
+      afterRtoTimeout(pitWeak, face, endpoint, lastNexthop);
+    });
 
   return true;
 }
@@ -226,15 +228,16 @@
   auto rtt = time::steady_clock::now() - outRecord->getLastRenewed();
   NFD_LOG_DEBUG(pitEntry->getInterest() << " dataFrom " << ingress
                 << " rtt=" << time::duration_cast<time::microseconds>(rtt).count());
-  this->updateMeasurements(ingress.face, data, time::duration_cast<RttEstimator::Duration>(rtt));
+  this->updateMeasurements(ingress.face, data, rtt);
 }
 
 void
-AccessStrategy::updateMeasurements(const Face& inFace, const Data& data,
-                                   const RttEstimator::Duration& rtt)
+AccessStrategy::updateMeasurements(const Face& inFace, const Data& data, time::nanoseconds rtt)
 {
-  ///\todo move FaceInfoTable out of AccessStrategy instance, to Measurements or somewhere else
-  FaceInfo& fi = m_fit[inFace.getId()];
+  auto ret = m_fit.emplace(std::piecewise_construct,
+                           std::forward_as_tuple(inFace.getId()),
+                           std::forward_as_tuple(m_rttEstimatorOpts));
+  FaceInfo& fi = ret.first->second;
   fi.rtt.addMeasurement(rtt);
 
   MtInfo* mi = this->addPrefixMeasurements(data);
@@ -276,14 +279,7 @@
   }
 
   this->getMeasurements().extendLifetime(*me, 8_s);
-
-  return me->insertStrategyInfo<MtInfo>().first;
-}
-
-void
-AccessStrategy::removeFaceInfo(const Face& face)
-{
-  m_fit.erase(face.getId());
+  return me->insertStrategyInfo<MtInfo>(m_rttEstimatorOpts).first;
 }
 
 } // namespace fw
