diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index db8a192..204aaaa 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -126,7 +126,7 @@
   }
 
   shared_ptr<Face> face = this->getFace(mi.lastNexthop);
-  if (face == nullptr || !fibEntry.hasNextHop(face)) {
+  if (face == nullptr || !fibEntry.hasNextHop(*face)) {
     NFD_LOG_DEBUG(pitEntry->getInterest() << " last-nexthop-gone");
     return false;
   }
@@ -140,7 +140,7 @@
   NFD_LOG_DEBUG(pitEntry->getInterest() << " interestTo " << mi.lastNexthop <<
                 " last-nexthop rto=" << time::duration_cast<time::microseconds>(rto).count());
 
-  this->sendInterest(pitEntry, face);
+  this->sendInterest(pitEntry, *face);
 
   // schedule RTO timeout
   shared_ptr<PitInfo> pi = pitEntry->getOrCreateStrategyInfo<PitInfo>();
@@ -171,11 +171,11 @@
                           std::unordered_set<FaceId> exceptFaces)
 {
   for (const fib::NextHop& nexthop : fibEntry.getNextHops()) {
-    shared_ptr<Face> face = nexthop.getFace();
-    if (exceptFaces.count(face->getId()) > 0) {
+    Face& face = nexthop.getFace();
+    if (exceptFaces.count(face.getId()) > 0) {
       continue;
     }
-    NFD_LOG_DEBUG(pitEntry->getInterest() << " interestTo " << face->getId() <<
+    NFD_LOG_DEBUG(pitEntry->getInterest() << " interestTo " << face.getId() <<
                   " multicast");
     this->sendInterest(pitEntry, face);
   }
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index f561b52..097a372 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -64,7 +64,7 @@
   });
 }
 
-shared_ptr<Face>
+Face*
 ProbingModule::getFaceToProbe(const Face& inFace,
                               const Interest& interest,
                               const fib::Entry& fibEntry,
@@ -84,23 +84,23 @@
   // Put eligible faces into rankedFaces. If a face does not have an RTT measurement,
   // immediately pick the face for probing
   for (const fib::NextHop& hop : fibEntry.getNextHops()) {
-    const shared_ptr<Face>& hopFace = hop.getFace();
+    Face& hopFace = hop.getFace();
 
     // Don't send probe Interest back to the incoming face or use the same face
     // as the forwarded Interest
-    if (hopFace->getId() == inFace.getId() || hopFace->getId() == faceUsed.getId()) {
+    if (hopFace.getId() == inFace.getId() || hopFace.getId() == faceUsed.getId()) {
       continue;
     }
 
-    FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest, *hopFace);
+    FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest, hopFace);
 
     // If no RTT has been recorded, probe this face
     if (info == nullptr || !info->hasSrttMeasurement()) {
-      return hopFace;
+      return &hopFace;
     }
 
     // Add FaceInfo to container sorted by RTT
-    rankedFaces.insert(std::make_pair(info, hopFace));
+    rankedFaces.insert(std::make_pair(info, &hopFace));
   }
 
   if (rankedFaces.empty()) {
@@ -140,7 +140,7 @@
   scheduleProbe(fibEntry, m_probingInterval);
 }
 
-shared_ptr<Face>
+Face*
 ProbingModule::getFaceBasedOnProbability(const FaceInfoFacePairSet& rankedFaces)
 {
   double randomNumber = getRandomNumber(0, 1);
diff --git a/daemon/fw/asf-probing-module.hpp b/daemon/fw/asf-probing-module.hpp
index 585b76a..3a4df6e 100644
--- a/daemon/fw/asf-probing-module.hpp
+++ b/daemon/fw/asf-probing-module.hpp
@@ -43,7 +43,7 @@
   void
   scheduleProbe(const fib::Entry& fibEntry, const time::milliseconds& interval);
 
-  shared_ptr<Face>
+  Face*
   getFaceToProbe(const Face& inFace,
                  const Interest& interest,
                  const fib::Entry& fibEntry,
@@ -57,11 +57,11 @@
 
 private:
   // Used to associate FaceInfo with the face in a NextHop
-  typedef std::pair<FaceInfo*, shared_ptr<Face>> FaceInfoFacePair;
+  typedef std::pair<FaceInfo*, Face*> FaceInfoFacePair;
   typedef std::function<bool(FaceInfoFacePair, FaceInfoFacePair)> FaceInfoPredicate;
   typedef std::set<FaceInfoFacePair, FaceInfoPredicate> FaceInfoFacePairSet;
 
-  shared_ptr<Face>
+  Face*
   getFaceBasedOnProbability(const FaceInfoFacePairSet& rankedFaces);
 
   double
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index cf616e8..3f8abf7 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -79,7 +79,7 @@
     return;
   }
 
-  const shared_ptr<Face> faceToUse = getBestFaceForForwarding(fibEntry, interest, inFace);
+  Face* faceToUse = getBestFaceForForwarding(fibEntry, interest, inFace);
 
   if (faceToUse == nullptr) {
     sendNoRouteNack(inFace, interest, pitEntry);
@@ -87,18 +87,18 @@
     return;
   }
 
-  forwardInterest(interest, fibEntry, pitEntry, faceToUse);
+  forwardInterest(interest, fibEntry, pitEntry, *faceToUse);
 
   // If necessary, send probe
   if (m_probing.isProbingNeeded(fibEntry, interest)) {
-    shared_ptr<Face> faceToProbe = m_probing.getFaceToProbe(inFace, interest, fibEntry, *faceToUse);
+    Face* faceToProbe = m_probing.getFaceToProbe(inFace, interest, fibEntry, *faceToUse);
 
     if (faceToProbe != nullptr) {
       NFD_LOG_TRACE("Sending probe for " << fibEntry.getPrefix()
                                          << " to FaceId: " << faceToProbe->getId());
 
       bool wantNewNonce = true;
-      forwardInterest(interest, fibEntry, pitEntry, faceToProbe, wantNewNonce);
+      forwardInterest(interest, fibEntry, pitEntry, *faceToProbe, wantNewNonce);
       m_probing.afterForwardingProbe(fibEntry, interest);
     }
   }
@@ -143,27 +143,27 @@
 AsfStrategy::forwardInterest(const Interest& interest,
                              const fib::Entry& fibEntry,
                              shared_ptr<pit::Entry> pitEntry,
-                             shared_ptr<Face> outFace,
+                             Face& outFace,
                              bool wantNewNonce)
 {
   this->sendInterest(pitEntry, outFace, wantNewNonce);
 
-  FaceInfo& faceInfo = m_measurements.getOrCreateFaceInfo(fibEntry, interest, *outFace);
+  FaceInfo& faceInfo = m_measurements.getOrCreateFaceInfo(fibEntry, interest, outFace);
 
   // Refresh measurements since Face is being used for forwarding
   NamespaceInfo& namespaceInfo = m_measurements.getOrCreateNamespaceInfo(fibEntry, interest);
-  namespaceInfo.extendFaceInfoLifetime(faceInfo, *outFace);
+  namespaceInfo.extendFaceInfoLifetime(faceInfo, outFace);
 
   if (!faceInfo.isTimeoutScheduled()) {
     // Estimate and schedule timeout
     RttEstimator::Duration timeout = faceInfo.computeRto();
 
     NFD_LOG_TRACE("Scheduling timeout for " << fibEntry.getPrefix()
-                                            << " FaceId: " << outFace->getId()
+                                            << " FaceId: " << outFace.getId()
                                             << " in " << time::duration_cast<time::milliseconds>(timeout) << " ms");
 
     scheduler::EventId id = scheduler::schedule(timeout,
-        bind(&AsfStrategy::onTimeout, this, interest.getName(), outFace->getId()));
+        bind(&AsfStrategy::onTimeout, this, interest.getName(), outFace.getId()));
 
     faceInfo.setTimeoutEvent(id, interest.getName());
   }
@@ -171,7 +171,7 @@
 
 struct FaceStats
 {
-  shared_ptr<Face> face;
+  Face* face;
   RttStats::Rtt rtt;
   RttStats::Rtt srtt;
   uint64_t cost;
@@ -196,7 +196,7 @@
   }
 }
 
-const shared_ptr<Face>
+Face*
 AsfStrategy::getBestFaceForForwarding(const fib::Entry& fibEntry, const ndn::Interest& interest, const Face& inFace)
 {
   NFD_LOG_TRACE("Looking for best face for " << fibEntry.getPrefix());
@@ -222,17 +222,16 @@
   });
 
   for (const fib::NextHop& hop : fibEntry.getNextHops()) {
+    Face& hopFace = hop.getFace();
 
-    const shared_ptr<Face>& hopFace = hop.getFace();
-
-    if (hopFace->getId() == inFace.getId()) {
+    if (hopFace.getId() == inFace.getId()) {
       continue;
     }
 
-    FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest, *hopFace);
+    FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest, hopFace);
 
     if (info == nullptr) {
-      FaceStats stats = {hopFace,
+      FaceStats stats = {&hopFace,
                          RttStats::RTT_NO_MEASUREMENT,
                          RttStats::RTT_NO_MEASUREMENT,
                          hop.getCost()};
@@ -240,7 +239,7 @@
       rankedFaces.insert(stats);
     }
     else {
-      FaceStats stats = {hopFace, info->getRtt(), info->getSrtt(), hop.getCost()};
+      FaceStats stats = {&hopFace, info->getRtt(), info->getSrtt(), hop.getCost()};
       rankedFaces.insert(stats);
     }
   }
diff --git a/daemon/fw/asf-strategy.hpp b/daemon/fw/asf-strategy.hpp
index cb50e01..ad00a3d 100644
--- a/daemon/fw/asf-strategy.hpp
+++ b/daemon/fw/asf-strategy.hpp
@@ -69,10 +69,10 @@
   forwardInterest(const Interest& interest,
                   const fib::Entry& fibEntry,
                   shared_ptr<pit::Entry> pitEntry,
-                  shared_ptr<Face> outFace,
+                  Face& outFace,
                   bool wantNewNonce = false);
 
-  const shared_ptr<Face>
+  Face*
   getBestFaceForForwarding(const fib::Entry& fibEntry, const ndn::Interest& interest, const Face& inFace);
 
   void
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
index bae5262..b97afca 100644
--- a/daemon/fw/best-route-strategy.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -54,14 +54,14 @@
   const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
   const fib::NextHopList& nexthops = fibEntry.getNextHops();
   fib::NextHopList::const_iterator it = std::find_if(nexthops.begin(), nexthops.end(),
-    [&pitEntry] (const fib::NextHop& nexthop) { return canForwardToLegacy(*pitEntry, *nexthop.getFace()); });
+    [&pitEntry] (const fib::NextHop& nexthop) { return canForwardToLegacy(*pitEntry, nexthop.getFace()); });
 
   if (it == nexthops.end()) {
     this->rejectPendingInterest(pitEntry);
     return;
   }
 
-  shared_ptr<Face> outFace = it->getFace();
+  Face& outFace = it->getFace();
   this->sendInterest(pitEntry, outFace);
 }
 
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index ef68175..df6ca4d 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -59,19 +59,19 @@
   bool wantUnused = false,
   time::steady_clock::TimePoint now = time::steady_clock::TimePoint::min())
 {
-  shared_ptr<Face> upstream = nexthop.getFace();
+  Face& upstream = nexthop.getFace();
 
   // upstream is current downstream
-  if (upstream->getId() == currentDownstream)
+  if (upstream.getId() == currentDownstream)
     return false;
 
   // forwarding would violate scope
-  if (violatesScope(*pitEntry, *upstream))
+  if (violatesScope(*pitEntry, upstream))
     return false;
 
   if (wantUnused) {
     // NextHop must not have unexpired out-record
-    pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(*upstream);
+    pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(upstream);
     if (outRecord != pitEntry->out_end() && outRecord->getExpiry() > now) {
       return false;
     }
@@ -93,7 +93,7 @@
   for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
     if (!predicate_NextHop_eligible(pitEntry, *it, currentDownstream))
       continue;
-    pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(*it->getFace());
+    pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(it->getFace());
     BOOST_ASSERT(outRecord != pitEntry->out_end());
     if (outRecord->getLastRenewed() < earliestRenewed) {
       found = it;
@@ -136,10 +136,10 @@
       return;
     }
 
-    shared_ptr<Face> outFace = it->getFace();
+    Face& outFace = it->getFace();
     this->sendInterest(pitEntry, outFace);
     NFD_LOG_DEBUG(interest << " from=" << inFace.getId()
-                           << " newPitEntry-to=" << outFace->getId());
+                           << " newPitEntry-to=" << outFace.getId());
     return;
   }
 
@@ -148,10 +148,10 @@
                     bind(&predicate_NextHop_eligible, pitEntry, _1, inFace.getId(),
                          true, time::steady_clock::now()));
   if (it != nexthops.end()) {
-    shared_ptr<Face> outFace = it->getFace();
+    Face& outFace = it->getFace();
     this->sendInterest(pitEntry, outFace);
     NFD_LOG_DEBUG(interest << " from=" << inFace.getId()
-                           << " retransmit-unused-to=" << outFace->getId());
+                           << " retransmit-unused-to=" << outFace.getId());
     return;
   }
 
@@ -161,10 +161,10 @@
     NFD_LOG_DEBUG(interest << " from=" << inFace.getId() << " retransmitNoNextHop");
   }
   else {
-    shared_ptr<Face> outFace = it->getFace();
+    Face& outFace = it->getFace();
     this->sendInterest(pitEntry, outFace);
     NFD_LOG_DEBUG(interest << " from=" << inFace.getId()
-                           << " retransmit-retry-to=" << outFace->getId());
+                           << " retransmit-retry-to=" << outFace.getId());
   }
 }
 
diff --git a/daemon/fw/best-route-strategy2.hpp b/daemon/fw/best-route-strategy2.hpp
index 8c6a778..d78baf6 100644
--- a/daemon/fw/best-route-strategy2.hpp
+++ b/daemon/fw/best-route-strategy2.hpp
@@ -56,10 +56,12 @@
 
   virtual void
   afterReceiveInterest(const Face& inFace, const Interest& interest,
+
                        shared_ptr<pit::Entry> pitEntry) override;
 
   virtual void
   afterReceiveNack(const Face& inFace, const lp::Nack& nack,
+
                    shared_ptr<pit::Entry> pitEntry) override;
 
 public:
diff --git a/daemon/fw/client-control-strategy.cpp b/daemon/fw/client-control-strategy.cpp
index 044e065..a73291b 100644
--- a/daemon/fw/client-control-strategy.cpp
+++ b/daemon/fw/client-control-strategy.cpp
@@ -66,7 +66,7 @@
     return;
   }
 
-  this->sendInterest(pitEntry, outFace);
+  this->sendInterest(pitEntry, *outFace);
 }
 
 } // namespace fw
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index b4bda23..4cda948 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -108,7 +108,7 @@
                " remote=" << face->getRemoteUri() <<
                " local=" << face->getLocalUri());
 
-  m_forwarder.getFib().removeNextHopFromAllEntries(face);
+  m_forwarder.getFib().removeNextHopFromAllEntries(*face);
 
   // defer Face deallocation, so that Transport isn't deallocated during afterStateChange signal
   getGlobalIoService().post([face] {});
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 3bb580d..0b4c653 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -522,7 +522,7 @@
   // has Link object?
   if (!interest.hasLink()) {
     // FIB lookup with Interest name
-    const fib::Entry& fibEntry = *m_fib.findLongestPrefixMatch(pitEntry);
+    const fib::Entry& fibEntry = m_fib.findLongestPrefixMatch(pitEntry);
     NFD_LOG_TRACE("lookupFib noLinkObject found=" << fibEntry.getPrefix());
     return fibEntry;
   }
@@ -532,7 +532,7 @@
   // in producer region?
   if (m_networkRegionTable.isInProducerRegion(link)) {
     // FIB lookup with Interest name
-    const fib::Entry& fibEntry = *m_fib.findLongestPrefixMatch(pitEntry);
+    const fib::Entry& fibEntry = m_fib.findLongestPrefixMatch(pitEntry);
     NFD_LOG_TRACE("lookupFib inProducerRegion found=" << fibEntry.getPrefix());
     return fibEntry;
   }
@@ -541,13 +541,13 @@
   if (interest.hasSelectedDelegation()) {
     // FIB lookup with SelectedDelegation
     Name selectedDelegation = interest.getSelectedDelegation();
-    const fib::Entry& fibEntry = *m_fib.findLongestPrefixMatch(selectedDelegation);
+    const fib::Entry& fibEntry = m_fib.findLongestPrefixMatch(selectedDelegation);
     NFD_LOG_TRACE("lookupFib hasSelectedDelegation=" << selectedDelegation << " found=" << fibEntry.getPrefix());
     return fibEntry;
   }
 
   // FIB lookup with first delegation Name
-  const fib::Entry& fibEntry0 = *m_fib.findLongestPrefixMatch(link.getDelegations().begin()->second);
+  const fib::Entry& fibEntry0 = m_fib.findLongestPrefixMatch(link.getDelegations().begin()->second);
   // in default-free zone?
   bool isDefaultFreeZone = !(fibEntry0.getPrefix().size() == 0 && fibEntry0.hasNextHops());
   if (!isDefaultFreeZone) {
@@ -558,7 +558,7 @@
   // choose and set SelectedDelegation
   for (const std::pair<uint32_t, Name>& delegation : link.getDelegations()) {
     const Name& delegationName = delegation.second;
-    const fib::Entry& fibEntry = *m_fib.findLongestPrefixMatch(delegationName);
+    const fib::Entry& fibEntry = m_fib.findLongestPrefixMatch(delegationName);
     if (fibEntry.hasNextHops()) {
       /// \todo Don't modify in-record Interests.
       ///       Set SelectedDelegation in outgoing Interest pipeline.
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index 9b89049..5373d03 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -46,8 +46,8 @@
   const fib::NextHopList& nexthops = fibEntry.getNextHops();
 
   for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
-    shared_ptr<Face> outFace = it->getFace();
-    if (canForwardToLegacy(*pitEntry, *outFace)) {
+    Face& outFace = it->getFace();
+    if (canForwardToLegacy(*pitEntry, outFace)) {
       this->sendInterest(pitEntry, outFace);
     }
   }
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index a459552..fc9cd20 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -74,13 +74,13 @@
   size_t nUpstreams = nexthops.size();
 
   shared_ptr<Face> bestFace = measurementsEntryInfo->getBestFace();
-  if (bestFace != nullptr && fibEntry.hasNextHop(bestFace) &&
+  if (bestFace != nullptr && fibEntry.hasNextHop(*bestFace) &&
       canForwardToLegacy(*pitEntry, *bestFace)) {
     // TODO Should we use `randlow = 100 + nrand48(h->seed) % 4096U;` ?
     deferFirst = measurementsEntryInfo->prediction;
     deferRange = time::microseconds((deferFirst.count() + 1) / 2);
     --nUpstreams;
-    this->sendInterest(pitEntry, bestFace);
+    this->sendInterest(pitEntry, *bestFace);
     pitEntryInfo->bestFaceTimeout = scheduler::schedule(
       measurementsEntryInfo->prediction,
       bind(&NccStrategy::timeoutOnBestFace, this, weak_ptr<pit::Entry>(pitEntry)));
@@ -89,7 +89,7 @@
     // use first eligible nexthop
     auto firstEligibleNexthop = std::find_if(nexthops.begin(), nexthops.end(),
         [&pitEntry] (const fib::NextHop& nexthop) {
-          return canForwardToLegacy(*pitEntry, *nexthop.getFace());
+          return canForwardToLegacy(*pitEntry, nexthop.getFace());
         });
     if (firstEligibleNexthop != nexthops.end()) {
       this->sendInterest(pitEntry, firstEligibleNexthop->getFace());
@@ -97,7 +97,7 @@
   }
 
   shared_ptr<Face> previousFace = measurementsEntryInfo->previousFace.lock();
-  if (previousFace != nullptr && fibEntry.hasNextHop(previousFace) &&
+  if (previousFace != nullptr && fibEntry.hasNextHop(*previousFace) &&
       canForwardToLegacy(*pitEntry, *previousFace)) {
     --nUpstreams;
   }
@@ -135,16 +135,16 @@
     this->getMeasurementsEntryInfo(pitEntry);
 
   shared_ptr<Face> previousFace = measurementsEntryInfo->previousFace.lock();
-  if (previousFace != nullptr && fibEntry.hasNextHop(previousFace) &&
+  if (previousFace != nullptr && fibEntry.hasNextHop(*previousFace) &&
       canForwardToLegacy(*pitEntry, *previousFace)) {
-    this->sendInterest(pitEntry, previousFace);
+    this->sendInterest(pitEntry, *previousFace);
   }
 
   const fib::NextHopList& nexthops = fibEntry.getNextHops();
   bool isForwarded = false;
   for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
-    shared_ptr<Face> face = it->getFace();
-    if (canForwardToLegacy(*pitEntry, *face)) {
+    Face& face = it->getFace();
+    if (canForwardToLegacy(*pitEntry, face)) {
       isForwarded = true;
       this->sendInterest(pitEntry, face);
       break;
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 3a11568..386dd7f 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -130,7 +130,7 @@
    *                      rather than reusing a Nonce from one of the PIT in-records
    */
   VIRTUAL_WITH_TESTS void
-  sendInterest(shared_ptr<pit::Entry> pitEntry, shared_ptr<Face> outFace,
+  sendInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace,
                bool wantNewNonce = false);
 
   /** \brief decide that a pending Interest cannot be forwarded
@@ -200,11 +200,9 @@
 }
 
 inline void
-Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry,
-                       shared_ptr<Face> outFace,
-                       bool wantNewNonce)
+Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace, bool wantNewNonce)
 {
-  m_forwarder.onOutgoingInterest(pitEntry, *outFace, wantNewNonce);
+  m_forwarder.onOutgoingInterest(pitEntry, outFace, wantNewNonce);
 }
 
 inline void
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 09e184a..b7ac209 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -61,11 +61,10 @@
                 << " faceid: " << faceId
                 << " cost: " << cost);
 
-  auto face = m_getFace(faceId);
-  if (static_cast<bool>(face)) {
-    auto entry = m_fib.insert(prefix).first;
-
-    entry->addNextHop(face, cost);
+  shared_ptr<Face> face = m_getFace(faceId);
+  if (face != nullptr) {
+    fib::Entry* entry = m_fib.insert(prefix).first;
+    entry->addNextHop(*face, cost);
 
     NFD_LOG_DEBUG("add-nexthop result: OK"
                   << " prefix:" << prefix
@@ -90,11 +89,11 @@
   NFD_LOG_TRACE("remove-nexthop prefix: " << parameters.getName()
                 << " faceid: " << parameters.getFaceId());
 
-  auto face = m_getFace(parameters.getFaceId());
-  if (static_cast<bool>(face)) {
-    auto entry = m_fib.findExactMatch(parameters.getName());
-    if (static_cast<bool>(entry)) {
-      entry->removeNextHop(face);
+  shared_ptr<Face> face = m_getFace(parameters.getFaceId());
+  if (face != nullptr) {
+    fib::Entry* entry = m_fib.findExactMatch(parameters.getName());
+    if (entry != nullptr) {
+      entry->removeNextHop(*face);
       NFD_LOG_DEBUG("remove-nexthop result: OK prefix: " << parameters.getName()
                     << " faceid: " << parameters.getFaceId());
 
@@ -124,7 +123,7 @@
 
     for (auto&& next : nextHops) {
       ndn::nfd::NextHopRecord nextHopRecord;
-      nextHopRecord.setFaceId(next.getFace()->getId());
+      nextHopRecord.setFaceId(next.getFace().getId());
       nextHopRecord.setCost(next.getCost());
 
       record.addNextHopRecord(nextHopRecord);
diff --git a/daemon/nfd.cpp b/daemon/nfd.cpp
index 5d9ce22..65fa80a 100644
--- a/daemon/nfd.cpp
+++ b/daemon/nfd.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -194,8 +194,7 @@
 
   // add FIB entry for NFD Management Protocol
   Name topPrefix("/localhost/nfd");
-  auto entry = m_forwarder->getFib().insert(topPrefix).first;
-  entry->addNextHop(m_internalFace, 0);
+  m_forwarder->getFib().insert(topPrefix).first->addNextHop(*m_internalFace, 0);
   m_dispatcher->addTopPrefix(topPrefix, false);
 }
 
diff --git a/daemon/table/fib-entry.cpp b/daemon/table/fib-entry.cpp
index b2ea76c..cb37b0f 100644
--- a/daemon/table/fib-entry.cpp
+++ b/daemon/table/fib-entry.cpp
@@ -1,12 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
+ * Copyright (c) 2014-2016,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -34,40 +34,37 @@
 }
 
 NextHopList::iterator
-Entry::findNextHop(Face& face)
+Entry::findNextHop(const Face& face)
 {
   return std::find_if(m_nextHops.begin(), m_nextHops.end(),
                       [&face] (const NextHop& nexthop) {
-                        return nexthop.getFace().get() == &face;
+                        return &nexthop.getFace() == &face;
                       });
 }
 
 bool
-Entry::hasNextHop(shared_ptr<Face> face) const
+Entry::hasNextHop(const Face& face) const
 {
-  return const_cast<Entry*>(this)->findNextHop(*face) != m_nextHops.end();
+  return const_cast<Entry*>(this)->findNextHop(face) != m_nextHops.end();
 }
 
 void
-Entry::addNextHop(shared_ptr<Face> face, uint64_t cost)
+Entry::addNextHop(Face& face, uint64_t cost)
 {
-  auto it = this->findNextHop(*face);
+  auto it = this->findNextHop(face);
   if (it == m_nextHops.end()) {
-    m_nextHops.push_back(fib::NextHop(face));
-    it = m_nextHops.end();
-    --it;
+    m_nextHops.emplace_back(face);
+    it = std::prev(m_nextHops.end());
   }
-  // now it refers to the NextHop for face
 
   it->setCost(cost);
-
   this->sortNextHops();
 }
 
 void
-Entry::removeNextHop(shared_ptr<Face> face)
+Entry::removeNextHop(const Face& face)
 {
-  auto it = this->findNextHop(*face);
+  auto it = this->findNextHop(face);
   if (it != m_nextHops.end()) {
     m_nextHops.erase(it);
   }
diff --git a/daemon/table/fib-entry.hpp b/daemon/table/fib-entry.hpp
index 9106d9f..8f83266 100644
--- a/daemon/table/fib-entry.hpp
+++ b/daemon/table/fib-entry.hpp
@@ -67,37 +67,33 @@
   bool
   hasNextHops() const;
 
-  /** \return whether there is a NextHop record for face
-   *
-   *  \todo change parameter type to Face&
+  /** \return whether there is a NextHop record for \p face
    */
   bool
-  hasNextHop(shared_ptr<Face> face) const;
+  hasNextHop(const Face& face) const;
 
   /** \brief adds a NextHop record
    *
-   *  If a NextHop record for face already exists, its cost is updated.
-   *  \note shared_ptr is passed by value because this function will take shared ownership
+   *  If a NextHop record for \p face already exists, its cost is updated.
    */
   void
-  addNextHop(shared_ptr<Face> face, uint64_t cost);
+  addNextHop(Face& face, uint64_t cost);
 
   /** \brief removes a NextHop record
    *
    *  If no NextHop record for face exists, do nothing.
-   *
-   *  \todo change parameter type to Face&
    */
   void
-  removeNextHop(shared_ptr<Face> face);
+  removeNextHop(const Face& face);
 
 private:
-  /** @note This method is non-const because normal iterator is needed by callers.
+  /** \note This method is non-const because mutable iterators are needed by callers.
    */
   NextHopList::iterator
-  findNextHop(Face& face);
+  findNextHop(const Face& face);
 
-  /// sorts the nexthop list
+  /** \brief sorts the nexthop list
+   */
   void
   sortNextHops();
 
diff --git a/daemon/table/fib-nexthop.cpp b/daemon/table/fib-nexthop.cpp
index 235fc79..e554362 100644
--- a/daemon/table/fib-nexthop.cpp
+++ b/daemon/table/fib-nexthop.cpp
@@ -1,12 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
+ * Copyright (c) 2014-2016,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -28,29 +28,11 @@
 namespace nfd {
 namespace fib {
 
-NextHop::NextHop(shared_ptr<Face> face)
-  : m_face(face)
+NextHop::NextHop(Face& face)
+  : m_face(&face)
   , m_cost(0)
 {
 }
 
-const shared_ptr<Face>&
-NextHop::getFace() const
-{
-  return m_face;
-}
-
-void
-NextHop::setCost(uint64_t cost)
-{
-  m_cost = cost;
-}
-
-uint64_t
-NextHop::getCost() const
-{
-  return m_cost;
-}
-
 } // namespace fib
 } // namespace nfd
diff --git a/daemon/table/fib-nexthop.hpp b/daemon/table/fib-nexthop.hpp
index 9f7ed93..c8c006e 100644
--- a/daemon/table/fib-nexthop.hpp
+++ b/daemon/table/fib-nexthop.hpp
@@ -1,12 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
+ * Copyright (c) 2014-2016,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -39,19 +39,28 @@
 {
 public:
   explicit
-  NextHop(shared_ptr<Face> face);
+  NextHop(Face& face);
 
-  const shared_ptr<Face>&
-  getFace() const;
-
-  void
-  setCost(uint64_t cost);
+  Face&
+  getFace() const
+  {
+    return *m_face;
+  }
 
   uint64_t
-  getCost() const;
+  getCost() const
+  {
+    return m_cost;
+  }
+
+  void
+  setCost(uint64_t cost)
+  {
+    m_cost = cost;
+  }
 
 private:
-  shared_ptr<Face> m_face;
+  Face* m_face;
   uint64_t m_cost;
 };
 
diff --git a/daemon/table/fib.cpp b/daemon/table/fib.cpp
index 946652e..2df3122 100644
--- a/daemon/table/fib.cpp
+++ b/daemon/table/fib.cpp
@@ -32,8 +32,9 @@
 #include <type_traits>
 
 namespace nfd {
+namespace fib {
 
-const shared_ptr<fib::Entry> Fib::s_emptyEntry = make_shared<fib::Entry>(Name());
+const unique_ptr<Entry> Fib::s_emptyEntry = make_unique<Entry>(Name());
 
 // http://en.cppreference.com/w/cpp/concept/ForwardIterator
 BOOST_CONCEPT_ASSERT((boost::ForwardIterator<Fib::const_iterator>));
@@ -57,39 +58,38 @@
 }
 
 static inline bool
-predicate_NameTreeEntry_hasFibEntry(const name_tree::Entry& entry)
+predicate_NameTreeEntry_hasFibEntry(const name_tree::Entry& nte)
 {
-  return entry.getFibEntry() != nullptr;
+  return nte.getFibEntry() != nullptr;
 }
 
-shared_ptr<fib::Entry>
+const Entry&
 Fib::findLongestPrefixMatch(const Name& prefix) const
 {
-  shared_ptr<name_tree::Entry> nameTreeEntry =
+  shared_ptr<name_tree::Entry> nte =
     m_nameTree.findLongestPrefixMatch(prefix, &predicate_NameTreeEntry_hasFibEntry);
-  if (nameTreeEntry != nullptr) {
-    return nameTreeEntry->getFibEntry();
+  if (nte != nullptr) {
+    return *nte->getFibEntry();
   }
-  return s_emptyEntry;
+  return *s_emptyEntry;
 }
 
-shared_ptr<fib::Entry>
-Fib::findLongestPrefixMatch(shared_ptr<name_tree::Entry> nameTreeEntry) const
+const Entry&
+Fib::findLongestPrefixMatch(shared_ptr<name_tree::Entry> nte) const
 {
-  shared_ptr<fib::Entry> entry = nameTreeEntry->getFibEntry();
+  Entry* entry = nte->getFibEntry();
   if (entry != nullptr)
-    return entry;
+    return *entry;
 
-  nameTreeEntry = m_nameTree.findLongestPrefixMatch(nameTreeEntry,
-                                                    &predicate_NameTreeEntry_hasFibEntry);
-  if (nameTreeEntry != nullptr) {
-    return nameTreeEntry->getFibEntry();
+  nte = m_nameTree.findLongestPrefixMatch(nte, &predicate_NameTreeEntry_hasFibEntry);
+  if (nte != nullptr) {
+    return *nte->getFibEntry();
   }
 
-  return s_emptyEntry;
+  return *s_emptyEntry;
 }
 
-shared_ptr<fib::Entry>
+const Entry&
 Fib::findLongestPrefixMatch(const pit::Entry& pitEntry) const
 {
   shared_ptr<name_tree::Entry> nte = m_nameTree.findLongestPrefixMatch(pitEntry);
@@ -97,82 +97,81 @@
   return findLongestPrefixMatch(nte);
 }
 
-shared_ptr<fib::Entry>
+const Entry&
 Fib::findLongestPrefixMatch(const measurements::Entry& measurementsEntry) const
 {
-  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(measurementsEntry);
-  BOOST_ASSERT(nameTreeEntry != nullptr);
-
-  return findLongestPrefixMatch(nameTreeEntry);
+  shared_ptr<name_tree::Entry> nte = m_nameTree.lookup(measurementsEntry);
+  BOOST_ASSERT(nte != nullptr);
+  return findLongestPrefixMatch(nte);
 }
 
-shared_ptr<fib::Entry>
-Fib::findExactMatch(const Name& prefix) const
+Entry*
+Fib::findExactMatch(const Name& prefix)
 {
-  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(prefix);
-  if (nameTreeEntry != nullptr)
-    return nameTreeEntry->getFibEntry();
+  shared_ptr<name_tree::Entry> nte = m_nameTree.findExactMatch(prefix);
+  if (nte != nullptr)
+    return nte->getFibEntry();
 
   return nullptr;
 }
 
-std::pair<shared_ptr<fib::Entry>, bool>
+std::pair<Entry*, bool>
 Fib::insert(const Name& prefix)
 {
-  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(prefix);
-  shared_ptr<fib::Entry> entry = nameTreeEntry->getFibEntry();
-  if (entry != nullptr)
+  shared_ptr<name_tree::Entry> nte = m_nameTree.lookup(prefix);
+  Entry* entry = nte->getFibEntry();
+  if (entry != nullptr) {
     return std::make_pair(entry, false);
+  }
 
-  entry = make_shared<fib::Entry>(prefix);
-  nameTreeEntry->setFibEntry(entry);
+  nte->setFibEntry(make_unique<Entry>(prefix));
   ++m_nItems;
-  return std::make_pair(entry, true);
+  return std::make_pair(nte->getFibEntry(), true);
 }
 
 void
-Fib::erase(shared_ptr<name_tree::Entry> nameTreeEntry)
+Fib::erase(shared_ptr<name_tree::Entry> nte)
 {
-  nameTreeEntry->setFibEntry(shared_ptr<fib::Entry>());
-  m_nameTree.eraseEntryIfEmpty(nameTreeEntry);
+  nte->setFibEntry(nullptr);
+  m_nameTree.eraseEntryIfEmpty(nte);
   --m_nItems;
 }
 
 void
 Fib::erase(const Name& prefix)
 {
-  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(prefix);
-  if (nameTreeEntry != nullptr) {
-    this->erase(nameTreeEntry);
+  shared_ptr<name_tree::Entry> nte = m_nameTree.findExactMatch(prefix);
+  if (nte != nullptr) {
+    this->erase(nte);
   }
 }
 
 void
-Fib::erase(const fib::Entry& entry)
+Fib::erase(const Entry& entry)
 {
-  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(entry);
-  if (nameTreeEntry != nullptr) {
-    this->erase(nameTreeEntry);
+  shared_ptr<name_tree::Entry> nte = m_nameTree.lookup(entry);
+  if (nte != nullptr) {
+    this->erase(nte);
   }
 }
 
 void
-Fib::removeNextHopFromAllEntries(shared_ptr<Face> face)
+Fib::removeNextHopFromAllEntries(const Face& face)
 {
-  std::list<fib::Entry*> toErase;
+  std::list<Entry*> toErase;
 
   auto&& enumerable = m_nameTree.fullEnumerate(&predicate_NameTreeEntry_hasFibEntry);
   for (const name_tree::Entry& nte : enumerable) {
-    shared_ptr<fib::Entry> entry = nte.getFibEntry();
+    Entry* entry = nte.getFibEntry();
     entry->removeNextHop(face);
     if (!entry->hasNextHops()) {
-      toErase.push_back(entry.get());
+      toErase.push_back(entry);
       // entry needs to be erased, but we must wait until the enumeration ends,
       // because otherwise NameTree iterator would be invalidated
     }
   }
 
-  for (fib::Entry* entry : toErase) {
+  for (Entry* entry : toErase) {
     this->erase(*entry);
   }
 }
@@ -183,4 +182,5 @@
   return const_iterator(m_nameTree.fullEnumerate(&predicate_NameTreeEntry_hasFibEntry).begin());
 }
 
+} // namespace fib
 } // namespace nfd
diff --git a/daemon/table/fib.hpp b/daemon/table/fib.hpp
index bde7428..bfe6684 100644
--- a/daemon/table/fib.hpp
+++ b/daemon/table/fib.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -33,13 +33,14 @@
 
 namespace measurements {
 class Entry;
-}
+} // namespace measurements
 namespace pit {
 class Entry;
-}
+} // namespace pit
 
-/** \class Fib
- *  \brief represents the FIB
+namespace fib {
+
+/** \brief represents the Forwarding Information Base (FIB)
  */
 class Fib : noncopyable
 {
@@ -53,44 +54,54 @@
   size() const;
 
 public: // lookup
-  /// performs a longest prefix match
-  shared_ptr<fib::Entry>
+  /** \brief performs a longest prefix match
+   */
+  const Entry&
   findLongestPrefixMatch(const Name& prefix) const;
 
-  /// performs a longest prefix match
-  shared_ptr<fib::Entry>
+  /** \brief performs a longest prefix match
+   *
+   *  This is equivalent to .findLongestPrefixMatch(pitEntry.getName())
+   */
+  const Entry&
   findLongestPrefixMatch(const pit::Entry& pitEntry) const;
 
-  /// performs a longest prefix match
-  shared_ptr<fib::Entry>
+  /** \brief performs a longest prefix match
+   *
+   *  This is equivalent to .findLongestPrefixMatch(measurementsEntry.getName())
+   */
+  const Entry&
   findLongestPrefixMatch(const measurements::Entry& measurementsEntry) const;
 
-  shared_ptr<fib::Entry>
-  findExactMatch(const Name& prefix) const;
+  /** \brief performs an exact match lookup
+   */
+  Entry*
+  findExactMatch(const Name& prefix);
 
 public: // mutation
   /** \brief inserts a FIB entry for prefix
+   *
    *  If an entry for exact same prefix exists, that entry is returned.
-   *  \return{ the entry, and true for new entry, false for existing entry }
+   *  \return the entry, and true for new entry or false for existing entry
    */
-  std::pair<shared_ptr<fib::Entry>, bool>
+  std::pair<Entry*, bool>
   insert(const Name& prefix);
 
   void
   erase(const Name& prefix);
 
   void
-  erase(const fib::Entry& entry);
+  erase(const Entry& entry);
 
-  /** \brief removes the NextHop record for face in all entrites
+  /** \brief removes the NextHop record for face in all entries
    *
-   *  This is usually invoked when face goes away.
+   *  This is usually invoked when face is destroyed.
    *  Removing the last NextHop in a FIB entry will erase the FIB entry.
    *
    *  \todo change parameter type to Face&
    */
   void
-  removeNextHopFromAllEntries(shared_ptr<Face> face);
+  removeNextHopFromAllEntries(const Face& face);
 
 public: // enumeration
   class const_iterator;
@@ -110,7 +121,7 @@
   const_iterator
   end() const;
 
-  class const_iterator : public std::iterator<std::forward_iterator_tag, const fib::Entry>
+  class const_iterator : public std::iterator<std::forward_iterator_tag, const Entry>
   {
   public:
     const_iterator() = default;
@@ -120,10 +131,10 @@
 
     ~const_iterator();
 
-    const fib::Entry&
+    const Entry&
     operator*() const;
 
-    shared_ptr<fib::Entry>
+    const Entry*
     operator->() const;
 
     const_iterator&
@@ -143,8 +154,8 @@
   };
 
 private:
-  shared_ptr<fib::Entry>
-  findLongestPrefixMatch(shared_ptr<name_tree::Entry> nameTreeEntry) const;
+  const Entry&
+  findLongestPrefixMatch(shared_ptr<name_tree::Entry> nte) const;
 
   void
   erase(shared_ptr<name_tree::Entry> nameTreeEntry);
@@ -153,13 +164,12 @@
   NameTree& m_nameTree;
   size_t m_nItems;
 
-  /** \brief The empty FIB entry.
+  /** \brief the empty FIB entry.
    *
    *  This entry has no nexthops.
    *  It is returned by findLongestPrefixMatch if nothing is matched.
-   *  Returning empty entry instead of nullptr makes forwarding and strategy implementation easier.
    */
-  static const shared_ptr<fib::Entry> s_emptyEntry;
+  static const unique_ptr<Entry> s_emptyEntry;
 };
 
 inline size_t
@@ -189,7 +199,7 @@
 Fib::const_iterator
 Fib::const_iterator::operator++(int)
 {
-  Fib::const_iterator temp(*this);
+  const_iterator temp(*this);
   ++(*this);
   return temp;
 }
@@ -201,30 +211,34 @@
   return *this;
 }
 
-inline const fib::Entry&
+inline const Entry&
 Fib::const_iterator::operator*() const
 {
-  return *this->operator->();
+  return *m_nameTreeIterator->getFibEntry();
 }
 
-inline shared_ptr<fib::Entry>
+inline const Entry*
 Fib::const_iterator::operator->() const
 {
   return m_nameTreeIterator->getFibEntry();
 }
 
 inline bool
-Fib::const_iterator::operator==(const Fib::const_iterator& other) const
+Fib::const_iterator::operator==(const const_iterator& other) const
 {
   return m_nameTreeIterator == other.m_nameTreeIterator;
 }
 
 inline bool
-Fib::const_iterator::operator!=(const Fib::const_iterator& other) const
+Fib::const_iterator::operator!=(const const_iterator& other) const
 {
   return m_nameTreeIterator != other.m_nameTreeIterator;
 }
 
+} // namespace fib
+
+using fib::Fib;
+
 } // namespace nfd
 
 #endif // NFD_DAEMON_TABLE_FIB_HPP
diff --git a/daemon/table/name-tree-entry.cpp b/daemon/table/name-tree-entry.cpp
index 889ed97..87853f2 100644
--- a/daemon/table/name-tree-entry.cpp
+++ b/daemon/table/name-tree-entry.cpp
@@ -65,14 +65,14 @@
 }
 
 void
-Entry::setFibEntry(shared_ptr<fib::Entry> fibEntry)
+Entry::setFibEntry(unique_ptr<fib::Entry> fibEntry)
 {
   BOOST_ASSERT(fibEntry == nullptr || fibEntry->m_nameTreeEntry.expired());
 
   if (m_fibEntry != nullptr) {
     m_fibEntry->m_nameTreeEntry.reset();
   }
-  m_fibEntry = fibEntry;
+  m_fibEntry = std::move(fibEntry);
 
   if (m_fibEntry != nullptr) {
     m_fibEntry->m_nameTreeEntry = this->shared_from_this();
diff --git a/daemon/table/name-tree-entry.hpp b/daemon/table/name-tree-entry.hpp
index 378d285..c650587 100644
--- a/daemon/table/name-tree-entry.hpp
+++ b/daemon/table/name-tree-entry.hpp
@@ -96,9 +96,9 @@
 
 public: // attached table entries
   void
-  setFibEntry(shared_ptr<fib::Entry> fibEntry);
+  setFibEntry(unique_ptr<fib::Entry> fibEntry);
 
-  shared_ptr<fib::Entry>
+  fib::Entry*
   getFibEntry() const;
 
   void
@@ -133,7 +133,7 @@
   Name m_prefix;
   shared_ptr<Entry> m_parent;     // Pointing to the parent entry.
   std::vector<shared_ptr<Entry> > m_children; // Children pointers.
-  shared_ptr<fib::Entry> m_fibEntry;
+  unique_ptr<fib::Entry> m_fibEntry;
   std::vector<shared_ptr<pit::Entry> > m_pitEntries;
   shared_ptr<measurements::Entry> m_measurementsEntry;
   shared_ptr<strategy_choice::Entry> m_strategyChoiceEntry;
@@ -187,10 +187,10 @@
   return !m_children.empty();
 }
 
-inline shared_ptr<fib::Entry>
+inline fib::Entry*
 Entry::getFibEntry() const
 {
-  return m_fibEntry;
+  return m_fibEntry.get();
 }
 
 inline bool
diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp
index 87d4154..796e701 100644
--- a/daemon/table/name-tree.cpp
+++ b/daemon/table/name-tree.cpp
@@ -244,7 +244,7 @@
 NameTree::lookup(const fib::Entry& fibEntry) const
 {
   shared_ptr<name_tree::Entry> nte = this->getEntry(fibEntry);
-  BOOST_ASSERT(nte == nullptr || nte->getFibEntry().get() == &fibEntry);
+  BOOST_ASSERT(nte == nullptr || nte->getFibEntry() == &fibEntry);
   return nte;
 }
 
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index a3b2aba..ac5c3ef 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -75,10 +75,10 @@
 
 BOOST_AUTO_TEST_CASE(Forward)
 {
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face1, 10);
-  fibEntry->addNextHop(face2, 20);
-  fibEntry->addNextHop(face3, 30);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face1, 10);
+  fibEntry.addNextHop(*face2, 20);
+  fibEntry.addNextHop(*face3, 30);
 
   shared_ptr<Interest> interest = makeInterest("ndn:/BzgFBchqA");
   shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
@@ -127,7 +127,7 @@
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[4].outFaceId, face1->getId());
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[5].outFaceId, face3->getId());
 
-  fibEntry->removeNextHop(face1);
+  fibEntry.removeNextHop(*face1);
 
   strategy.sendInterestHistory.clear();
   for (int i = 0; i < 3; ++i) {
@@ -153,10 +153,10 @@
     return "/P";
   }
 
-  shared_ptr<fib::Entry>
-  makeFibEntry(BestRouteStrategy2Fixture* fixture)
+  void
+  insertFibEntry(BestRouteStrategy2Fixture* fixture)
   {
-    return fixture->fib.insert(Name()).first;
+    fixture->fib.insert(Name());
   }
 };
 
@@ -169,12 +169,10 @@
     return "/P";
   }
 
-  shared_ptr<fib::Entry>
-  makeFibEntry(BestRouteStrategy2Fixture* fixture)
+  void
+  insertFibEntry(BestRouteStrategy2Fixture* fixture)
   {
-    shared_ptr<fib::Entry> fibEntry = fixture->fib.insert(Name()).first;
-    fibEntry->addNextHop(fixture->face1, 10);
-    return fibEntry;
+    fixture->fib.insert(Name()).first->addNextHop(*fixture->face1, 10);
   }
 };
 
@@ -187,13 +185,11 @@
     return "/localhop/P";
   }
 
-  shared_ptr<fib::Entry>
-  makeFibEntry(BestRouteStrategy2Fixture* fixture)
+  void
+  insertFibEntry(BestRouteStrategy2Fixture* fixture)
   {
-    shared_ptr<fib::Entry> fibEntry = fixture->fib.insert("/localhop").first;
-    fibEntry->addNextHop(fixture->face2, 10);
+    fixture->fib.insert("/localhop").first->addNextHop(*fixture->face2, 10);
     // face1 and face2 are both non-local; Interest from face1 cannot be forwarded to face2
-    return fibEntry;
   }
 };
 
@@ -202,13 +198,12 @@
 BOOST_AUTO_TEST_CASE_TEMPLATE(IncomingInterest, Scenario, NoRouteScenarios)
 {
   Scenario scenario;
+  scenario.insertFibEntry(this);
 
   shared_ptr<Interest> interest = makeInterest(scenario.getInterestName());
   shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(face1, *interest);
 
-  shared_ptr<fib::Entry> fibEntry = scenario.makeFibEntry(this);
-
   strategy.afterReceiveInterest(*face1, *interest, pitEntry);
 
   BOOST_REQUIRE_EQUAL(strategy.rejectPendingInterestHistory.size(), 1);
@@ -226,10 +221,10 @@
 
 BOOST_AUTO_TEST_CASE(OneUpstream) // one upstream, send Nack when Nack arrives
 {
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face3, 10);
-  fibEntry->addNextHop(face4, 20);
-  fibEntry->addNextHop(face5, 30);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face3, 10);
+  fibEntry.addNextHop(*face4, 20);
+  fibEntry.addNextHop(*face5, 30);
 
   shared_ptr<Interest> interest1 = makeInterest("/McQYjMbm", 992);
   shared_ptr<Interest> interest2 = makeInterest("/McQYjMbm", 114);
@@ -256,10 +251,10 @@
 
 BOOST_AUTO_TEST_CASE(TwoUpstreams) // two upstreams, send Nack when both Nacks arrive
 {
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face3, 10);
-  fibEntry->addNextHop(face4, 20);
-  fibEntry->addNextHop(face5, 30);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face3, 10);
+  fibEntry.addNextHop(*face4, 20);
+  fibEntry.addNextHop(*face5, 30);
 
   shared_ptr<Interest> interest1 = makeInterest("/aS9FAyUV19", 286);
   shared_ptr<pit::Entry> pitEntry = pit.insert(*interest1).first;
@@ -285,10 +280,10 @@
 
 BOOST_AUTO_TEST_CASE(Timeout) // two upstreams, one times out, don't send Nack
 {
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face3, 10);
-  fibEntry->addNextHop(face4, 20);
-  fibEntry->addNextHop(face5, 30);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face3, 10);
+  fibEntry.addNextHop(*face4, 20);
+  fibEntry.addNextHop(*face5, 30);
 
   shared_ptr<Interest> interest1 = makeInterest("/sIYw0TXWDj", 115);
   interest1->setInterestLifetime(time::milliseconds(400));
@@ -429,10 +424,10 @@
 {
   Combination combination;
 
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face3, 10);
-  fibEntry->addNextHop(face4, 20);
-  fibEntry->addNextHop(face5, 30);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face3, 10);
+  fibEntry.addNextHop(*face4, 20);
+  fibEntry.addNextHop(*face5, 30);
 
   shared_ptr<Interest> interest1 = makeInterest("/F6sEwB24I", 282);
   shared_ptr<pit::Entry> pitEntry = pit.insert(*interest1).first;
diff --git a/tests/daemon/fw/client-control-strategy.t.cpp b/tests/daemon/fw/client-control-strategy.t.cpp
index 0305b47..0a31244 100644
--- a/tests/daemon/fw/client-control-strategy.t.cpp
+++ b/tests/daemon/fw/client-control-strategy.t.cpp
@@ -54,8 +54,8 @@
   forwarder.addFace(face4);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face2, 0);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face2, 0);
 
   Pit& pit = forwarder.getPit();
 
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index ca6a858..17831fd 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -63,7 +63,7 @@
     }
 
     if (interestOutFace) {
-      this->sendInterest(pitEntry, interestOutFace);
+      this->sendInterest(pitEntry, *interestOutFace);
     }
     else {
       this->rejectPendingInterest(pitEntry);
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 1a4de92..7f2bc41 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -39,12 +39,9 @@
 {
   Forwarder forwarder;
 
-  Name nameA("ndn:/A");
-  Name nameAB("ndn:/A/B");
-  Name nameABC("ndn:/A/B/C");
-  shared_ptr<Interest> interestAB = makeInterest(nameAB);
+  shared_ptr<Interest> interestAB = makeInterest("/A/B");
   interestAB->setInterestLifetime(time::seconds(4));
-  shared_ptr<Data> dataABC = makeData(nameABC);
+  shared_ptr<Data> dataABC = makeData("/A/B/C");
 
   auto face1 = make_shared<DummyFace>();
   auto face2 = make_shared<DummyFace>();
@@ -52,15 +49,14 @@
   forwarder.addFace(face2);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
-  fibEntry->addNextHop(face2, 0);
+  fib.insert("/A").first->addNextHop(*face2, 0);
 
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInInterests, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutInterests, 0);
   face1->receiveInterest(*interestAB);
   this->advanceClocks(time::milliseconds(100), time::seconds(1));
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
-  BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), nameAB);
+  BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), "/A/B");
   BOOST_REQUIRE(face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
   BOOST_CHECK_EQUAL(*face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>(), face1->getId());
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInInterests, 1);
@@ -71,7 +67,7 @@
   face2->receiveData(*dataABC);
   this->advanceClocks(time::milliseconds(100), time::seconds(1));
   BOOST_REQUIRE_EQUAL(face1->sentData.size(), 1);
-  BOOST_CHECK_EQUAL(face1->sentData[0].getName(), nameABC);
+  BOOST_CHECK_EQUAL(face1->sentData[0].getName(), "/A/B/C");
   BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
   BOOST_CHECK_EQUAL(*face1->sentData[0].getTag<lp::IncomingFaceIdTag>(), face2->getId());
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInData, 1);
@@ -89,14 +85,13 @@
   forwarder.addFace(face2);
   forwarder.addFace(face3);
 
-  shared_ptr<Interest> interestA = makeInterest("ndn:/A");
+  shared_ptr<Interest> interestA = makeInterest("/A");
   interestA->setInterestLifetime(time::seconds(4));
-  shared_ptr<Data> dataA = makeData("ndn:/A");
+  shared_ptr<Data> dataA = makeData("/A");
   dataA->setTag(make_shared<lp::IncomingFaceIdTag>(face3->getId()));
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
-  fibEntry->addNextHop(face2, 0);
+  fib.insert("/A").first->addNextHop(*face2, 0);
 
   Pit& pit = forwarder.getPit();
   BOOST_CHECK_EQUAL(pit.size(), 0);
@@ -130,7 +125,7 @@
   forwarder.addFace(face3);
 
   Pit& pit = forwarder.getPit();
-  auto interestA1 = makeInterest("ndn:/A");
+  auto interestA1 = makeInterest("/A");
   interestA1->setNonce(8378);
   shared_ptr<pit::Entry> pitA = pit.insert(*interestA1).first;
   pit::InRecordCollection::iterator inA1 = pitA->insertOrUpdateInRecord(face1, *interestA1);
@@ -153,7 +148,7 @@
   BOOST_CHECK_EQUAL(face1->sentInterests.back().getNonce(), 8378);
 
   this->advanceClocks(time::seconds(2));
-  auto interestA2 = makeInterest("ndn:/A");
+  auto interestA2 = makeInterest("/A");
   interestA2->setNonce(9102);
   pitA->insertOrUpdateInRecord(face2, *interestA2);
 
@@ -644,8 +639,7 @@
   forwarder.addFace(face4);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name("/zT4XwK0Hnx")).first;
-  fibEntry->addNextHop(face4, 0);
+  fib.insert("/zT4XwK0Hnx").first->addNextHop(*face4, 0);
 
   // receive Interest on face1
   face1->sentNacks.clear();
@@ -699,8 +693,7 @@
   });
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
-  fibEntry->addNextHop(face2, 0);
+  fib.insert("/A").first->addNextHop(*face2, 0);
 
   // receive an Interest
   shared_ptr<Interest> interest = makeInterest("ndn:/A/1");
@@ -758,8 +751,7 @@
   // consumer region
   nrt.clear();
   nrt.insert("/arizona/cs/avenir");
-  shared_ptr<fib::Entry> fibRoot = fib.insert("/").first;
-  fibRoot->addNextHop(face2, 10);
+  fib.insert("/").first->addNextHop(*face2, 10);
 
   auto interest1 = makeInterest("/net/ndnsim/www/1.html");
   interest1->setLink(link->wireEncode());
@@ -769,15 +761,13 @@
   BOOST_CHECK_EQUAL(forwarder.lookupFib(*pit1).getPrefix(), "/");
   BOOST_CHECK_EQUAL(interest1->hasSelectedDelegation(), false);
 
-  fibRoot->removeNextHop(face2);
+  fib.insert("/").first->removeNextHop(*face2);
 
   // first default-free router, both delegations are available
   nrt.clear();
   nrt.insert("/arizona/cs/hobo");
-  shared_ptr<fib::Entry> fibTelia = fib.insert("/telia").first;
-  fibTelia->addNextHop(face2, 10);
-  shared_ptr<fib::Entry> fibUcla = fib.insert("/ucla").first;
-  fibUcla->addNextHop(face2, 10);
+  fib.insert("/telia").first->addNextHop(*face2, 10);
+  fib.insert("/ucla").first->addNextHop(*face2, 10);
 
   auto interest2 = makeInterest("/net/ndnsim/www/2.html");
   interest2->setLink(link->wireEncode());
@@ -788,14 +778,13 @@
   BOOST_REQUIRE_EQUAL(interest2->hasSelectedDelegation(), true);
   BOOST_CHECK_EQUAL(interest2->getSelectedDelegation(), "/telia/terabits");
 
-  fib.erase(*fibTelia);
-  fib.erase(*fibUcla);
+  fib.erase("/telia");
+  fib.erase("/ucla");
 
   // first default-free router, only second delegation is available
   nrt.clear();
   nrt.insert("/arizona/cs/hobo");
-  fibUcla = fib.insert("/ucla").first;
-  fibUcla->addNextHop(face2, 10);
+  fib.insert("/ucla").first->addNextHop(*face2, 10);
 
   auto interest3 = makeInterest("/net/ndnsim/www/3.html");
   interest3->setLink(link->wireEncode());
@@ -806,15 +795,13 @@
   BOOST_REQUIRE_EQUAL(interest3->hasSelectedDelegation(), true);
   BOOST_CHECK_EQUAL(interest3->getSelectedDelegation(), "/ucla/cs");
 
-  fib.erase(*fibUcla);
+  fib.erase("/ucla");
 
   // default-free router, chosen SelectedDelegation
   nrt.clear();
   nrt.insert("/ucsd/caida/click");
-  fibTelia = fib.insert("/telia").first;
-  fibTelia->addNextHop(face2, 10);
-  fibUcla = fib.insert("/ucla").first;
-  fibUcla->addNextHop(face2, 10);
+  fib.insert("/telia").first->addNextHop(*face2, 10);
+  fib.insert("/ucla").first->addNextHop(*face2, 10);
 
   auto interest4 = makeInterest("/net/ndnsim/www/4.html");
   interest4->setLink(link->wireEncode());
@@ -826,17 +813,15 @@
   BOOST_REQUIRE_EQUAL(interest4->hasSelectedDelegation(), true);
   BOOST_CHECK_EQUAL(interest4->getSelectedDelegation(), "/ucla/cs");
 
-  fib.erase(*fibTelia);
-  fib.erase(*fibUcla);
+  fib.erase("/telia");
+  fib.erase("/ucla");
 
   // producer region
   nrt.clear();
   nrt.insert("/ucla/cs/spurs");
-  fibRoot->addNextHop(face2, 10);
-  fibUcla = fib.insert("/ucla").first;
-  fibUcla->addNextHop(face2, 10);
-  shared_ptr<fib::Entry> fibNdnsim = fib.insert("/net/ndnsim").first;
-  fibNdnsim->addNextHop(face2, 10);
+  fib.insert("/").first->addNextHop(*face2, 10);
+  fib.insert("/ucla").first->addNextHop(*face2, 10);
+  fib.insert("/net/ndnsim").first->addNextHop(*face2, 10);
 
   auto interest5 = makeInterest("/net/ndnsim/www/5.html");
   interest5->setLink(link->wireEncode());
@@ -848,9 +833,9 @@
   BOOST_REQUIRE_EQUAL(interest5->hasSelectedDelegation(), true);
   BOOST_CHECK_EQUAL(interest5->getSelectedDelegation(), "/ucla/cs");
 
-  fibRoot->removeNextHop(face2);
-  fib.erase(*fibUcla);
-  fib.erase(*fibNdnsim);
+  fib.insert("/").first->removeNextHop(*face2);
+  fib.erase("/ucla");
+  fib.erase("/ndnsim");
 }
 
 
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index 5204821..2800dc7 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -52,10 +52,10 @@
   forwarder.addFace(face3);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face1, 0);
-  fibEntry->addNextHop(face2, 0);
-  fibEntry->addNextHop(face3, 0);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face1, 0);
+  fibEntry.addNextHop(*face2, 0);
+  fibEntry.addNextHop(*face3, 0);
 
   shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
   Pit& pit = forwarder.getPit();
@@ -88,8 +88,8 @@
   forwarder.addFace(face2);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert("ndn:/localhop/uS09bub6tm").first;
-  fibEntry->addNextHop(face2, 0);
+  fib::Entry& fibEntry = *fib.insert("ndn:/localhop/uS09bub6tm").first;
+  fibEntry.addNextHop(*face2, 0);
 
   shared_ptr<Interest> interest = makeInterest("ndn:/localhop/uS09bub6tm/eG3MMoP6z");
   Pit& pit = forwarder.getPit();
@@ -111,8 +111,8 @@
   forwarder.addFace(face1);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face1, 0);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face1, 0);
 
   shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
   Pit& pit = forwarder.getPit();
diff --git a/tests/daemon/fw/ncc-strategy.t.cpp b/tests/daemon/fw/ncc-strategy.t.cpp
index 9fec06b..b624c74 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -62,9 +62,9 @@
   forwarder.addFace(face3);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face1, 10);
-  fibEntry->addNextHop(face2, 20);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face1, 10);
+  fibEntry.addNextHop(*face2, 20);
 
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   strategyChoice.install(strategy);
@@ -126,8 +126,8 @@
   forwarder.addFace(face3);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face1, 10);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face1, 10);
 
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   strategyChoice.install(strategy);
@@ -162,7 +162,7 @@
   strategy->afterReceiveInterest(*face3, *interest2, pitEntry2);
 
   // FIB entry is changed before doPropagate executes
-  fibEntry->addNextHop(face2, 20);
+  fibEntry.addNextHop(*face2, 20);
   this->advanceClocks(time::milliseconds(10), time::milliseconds(1000));// should not crash
 }
 
@@ -182,9 +182,9 @@
   forwarder.addFace(face3);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face1, 10);
-  fibEntry->addNextHop(face2, 20);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face1, 10);
+  fibEntry.addNextHop(*face2, 20);
 
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   strategyChoice.install(strategy);
@@ -242,8 +242,8 @@
   forwarder.addFace(face2);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face2, 10);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face2, 10);
 
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   strategyChoice.install(strategy);
@@ -292,9 +292,9 @@
   forwarder.addFace(face2);
 
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
-  fibEntry->addNextHop(face1, 10); // face1 is top-ranked nexthop
-  fibEntry->addNextHop(face2, 20);
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fibEntry.addNextHop(*face1, 10); // face1 is top-ranked nexthop
+  fibEntry.addNextHop(*face2, 20);
 
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   strategyChoice.install(strategy);
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index ed831ff..da79517 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -53,7 +53,7 @@
 protected:
   virtual void
   sendInterest(shared_ptr<pit::Entry> pitEntry,
-               shared_ptr<Face> outFace,
+               Face& outFace,
                bool wantNewNonce = false) override;
 
   virtual void
@@ -91,12 +91,12 @@
 template<typename S>
 inline void
 StrategyTester<S>::sendInterest(shared_ptr<pit::Entry> pitEntry,
-                                shared_ptr<Face> outFace,
+                                Face& outFace,
                                 bool wantNewNonce)
 {
-  SendInterestArgs args{pitEntry, outFace->getId(), wantNewNonce};
+  SendInterestArgs args{pitEntry, outFace.getId(), wantNewNonce};
   sendInterestHistory.push_back(args);
-  pitEntry->insertOrUpdateOutRecord(outFace, pitEntry->getInterest());
+  pitEntry->insertOrUpdateOutRecord(outFace.shared_from_this(), pitEntry->getInterest());
   afterAction();
 }
 
diff --git a/tests/daemon/fw/topology-tester.cpp b/tests/daemon/fw/topology-tester.cpp
index b1eeb6a..9224b40 100644
--- a/tests/daemon/fw/topology-tester.cpp
+++ b/tests/daemon/fw/topology-tester.cpp
@@ -184,8 +184,7 @@
 {
   Forwarder& forwarder = this->getForwarder(i);
   Fib& fib = forwarder.getFib();
-  shared_ptr<fib::Entry> fibEntry = fib.insert(prefix).first;
-  fibEntry->addNextHop(const_cast<Face&>(face).shared_from_this(), cost);
+  fib.insert(prefix).first->addNextHop(const_cast<Face&>(face), cost);
 }
 
 void
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index ee56cf7..9e5f285 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -94,19 +94,19 @@
   checkNextHop(const Name& prefix, ssize_t expectedNNextHops = -1,
                FaceId faceId = face::FACEID_NULL, int32_t expectedCost = -1)
   {
-    auto entry = m_fib.findExactMatch(prefix);
-    if (!static_cast<bool>(entry)) {
+    const fib::Entry* entry = m_fib.findExactMatch(prefix);
+    if (entry == nullptr) {
       return CheckNextHopResult::NO_FIB_ENTRY;
     }
 
-    auto nextHops = entry->getNextHops();
+    const fib::NextHopList& nextHops = entry->getNextHops();
     if (expectedNNextHops != -1 && nextHops.size() != static_cast<size_t>(expectedNNextHops)) {
       return CheckNextHopResult::WRONG_N_NEXTHOPS;
     }
 
     if (faceId != face::FACEID_NULL) {
       for (auto&& record : nextHops) {
-        if (record.getFace()->getId() == faceId) {
+        if (record.getFace().getId() == faceId) {
           return expectedCost != -1 && record.getCost() != static_cast<uint32_t>(expectedCost) ?
             CheckNextHopResult::WRONG_COST : CheckNextHopResult::OK;
         }
@@ -285,10 +285,10 @@
   BOOST_REQUIRE_NE(face2, face::INVALID_FACEID);
   BOOST_REQUIRE_NE(face3, face::INVALID_FACEID);
 
-  shared_ptr<fib::Entry> entry = m_fib.insert("/hello").first;
-  entry->addNextHop(m_faceTable.get(face1), 101);
-  entry->addNextHop(m_faceTable.get(face2), 202);
-  entry->addNextHop(m_faceTable.get(face3), 303);
+  fib::Entry* entry = m_fib.insert("/hello").first;
+  entry->addNextHop(*m_faceTable.get(face1), 101);
+  entry->addNextHop(*m_faceTable.get(face2), 202);
+  entry->addNextHop(*m_faceTable.get(face3), 303);
 
   testRemoveNextHop(makeParameters("/hello", face1));
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
@@ -340,9 +340,9 @@
     receiveInterest(command);
   };
 
-  shared_ptr<fib::Entry> entry = m_fib.insert("/hello").first;
-  entry->addNextHop(m_faceTable.get(face1), 101);
-  entry->addNextHop(m_faceTable.get(face2), 202);
+  fib::Entry* entry = m_fib.insert("/hello").first;
+  entry->addNextHop(*m_faceTable.get(face1), 101);
+  entry->addNextHop(*m_faceTable.get(face2), 202);
 
   testWithImplicitFaceId(ControlParameters().setName("/hello").setFaceId(0), face1);
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
@@ -372,7 +372,7 @@
     receiveInterest(command);
   };
 
-  m_fib.insert("/hello").first->addNextHop(m_faceTable.get(face1), 101);
+  m_fib.insert("/hello").first->addNextHop(*m_faceTable.get(face1), 101);
 
   testRemoveNextHop(makeParameters("/hello", face2 + 100));
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1); // face does not exist
@@ -446,9 +446,9 @@
   for (size_t i = 0 ; i < nEntries ; i ++) {
     Name prefix = Name("test").appendSegment(i);
     actualPrefixes.insert(prefix);
-    auto fibEntry = m_fib.insert(prefix).first;
-    fibEntry->addNextHop(m_faceTable.get(addFace()), std::numeric_limits<uint8_t>::max() - 1);
-    fibEntry->addNextHop(m_faceTable.get(addFace()), std::numeric_limits<uint8_t>::max() - 2);
+    fib::Entry* fibEntry = m_fib.insert(prefix).first;
+    fibEntry->addNextHop(*m_faceTable.get(addFace()), std::numeric_limits<uint8_t>::max() - 1);
+    fibEntry->addNextHop(*m_faceTable.get(addFace()), std::numeric_limits<uint8_t>::max() - 2);
   }
 
   receiveInterest(makeInterest("/localhost/nfd/fib/list"));
@@ -476,7 +476,7 @@
     const auto& nextHops = matchedEntry->getNextHops();
     for (auto&& next : nextHops) {
       ndn::nfd::NextHopRecord nextHopRecord;
-      nextHopRecord.setFaceId(next.getFace()->getId());
+      nextHopRecord.setFaceId(next.getFace().getId());
       nextHopRecord.setCost(next.getCost());
       record.addNextHopRecord(nextHopRecord);
     }
diff --git a/tests/daemon/table/fib.t.cpp b/tests/daemon/table/fib.t.cpp
index 30846f4..7071c19 100644
--- a/tests/daemon/table/fib.t.cpp
+++ b/tests/daemon/table/fib.t.cpp
@@ -31,174 +31,142 @@
 #include "tests/test-common.hpp"
 
 namespace nfd {
+namespace fib {
 namespace tests {
 
+using namespace nfd::tests;
+
 BOOST_AUTO_TEST_SUITE(Table)
 BOOST_FIXTURE_TEST_SUITE(TestFib, BaseFixture)
 
-BOOST_AUTO_TEST_CASE(Entry)
+BOOST_AUTO_TEST_CASE(FibEntry)
 {
   Name prefix("ndn:/pxWhfFza");
   shared_ptr<Face> face1 = make_shared<DummyFace>();
   shared_ptr<Face> face2 = make_shared<DummyFace>();
 
-  fib::Entry entry(prefix);
+  Entry entry(prefix);
   BOOST_CHECK_EQUAL(entry.getPrefix(), prefix);
 
-  const fib::NextHopList& nexthops1 = entry.getNextHops();
   // []
-  BOOST_CHECK_EQUAL(nexthops1.size(), 0);
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 0);
 
-  entry.addNextHop(face1, 20);
-  const fib::NextHopList& nexthops2 = entry.getNextHops();
+  entry.addNextHop(*face1, 20);
   // [(face1,20)]
-  BOOST_CHECK_EQUAL(nexthops2.size(), 1);
-  BOOST_CHECK_EQUAL(nexthops2.begin()->getFace(), face1);
-  BOOST_CHECK_EQUAL(nexthops2.begin()->getCost(), 20);
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
+  BOOST_CHECK_EQUAL(&entry.getNextHops().begin()->getFace(), face1.get());
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 20);
 
-  entry.addNextHop(face1, 30);
-  const fib::NextHopList& nexthops3 = entry.getNextHops();
+  entry.addNextHop(*face1, 30);
   // [(face1,30)]
-  BOOST_CHECK_EQUAL(nexthops3.size(), 1);
-  BOOST_CHECK_EQUAL(nexthops3.begin()->getFace(), face1);
-  BOOST_CHECK_EQUAL(nexthops3.begin()->getCost(), 30);
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
+  BOOST_CHECK_EQUAL(&entry.getNextHops().begin()->getFace(), face1.get());
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 30);
 
-  entry.addNextHop(face2, 40);
-  const fib::NextHopList& nexthops4 = entry.getNextHops();
+  entry.addNextHop(*face2, 40);
   // [(face1,30), (face2,40)]
-  BOOST_CHECK_EQUAL(nexthops4.size(), 2);
-  int i = -1;
-  for (fib::NextHopList::const_iterator it = nexthops4.begin();
-       it != nexthops4.end(); ++it) {
-    ++i;
-    switch (i) {
-      case 0:
-        BOOST_CHECK_EQUAL(it->getFace(), face1);
-        BOOST_CHECK_EQUAL(it->getCost(), 30);
-        break;
-      case 1:
-        BOOST_CHECK_EQUAL(it->getFace(), face2);
-        BOOST_CHECK_EQUAL(it->getCost(), 40);
-        break;
-    }
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 2);
+  {
+    NextHopList::const_iterator it = entry.getNextHops().begin();
+    BOOST_REQUIRE(it != entry.getNextHops().end());
+    BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
+    BOOST_CHECK_EQUAL(it->getCost(), 30);
+
+    ++it;
+    BOOST_REQUIRE(it != entry.getNextHops().end());
+    BOOST_CHECK_EQUAL(&it->getFace(), face2.get());
+    BOOST_CHECK_EQUAL(it->getCost(), 40);
+
+    ++it;
+    BOOST_CHECK(it == entry.getNextHops().end());
   }
 
-  entry.addNextHop(face2, 10);
-  const fib::NextHopList& nexthops5 = entry.getNextHops();
+  entry.addNextHop(*face2, 10);
   // [(face2,10), (face1,30)]
-  BOOST_CHECK_EQUAL(nexthops5.size(), 2);
-  i = -1;
-  for (fib::NextHopList::const_iterator it = nexthops5.begin();
-       it != nexthops5.end(); ++it) {
-    ++i;
-    switch (i) {
-      case 0:
-        BOOST_CHECK_EQUAL(it->getFace(), face2);
-        BOOST_CHECK_EQUAL(it->getCost(), 10);
-        break;
-      case 1:
-        BOOST_CHECK_EQUAL(it->getFace(), face1);
-        BOOST_CHECK_EQUAL(it->getCost(), 30);
-        break;
-    }
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 2);
+  {
+    NextHopList::const_iterator it = entry.getNextHops().begin();
+    BOOST_REQUIRE(it != entry.getNextHops().end());
+    BOOST_CHECK_EQUAL(&it->getFace(), face2.get());
+    BOOST_CHECK_EQUAL(it->getCost(), 10);
+
+    ++it;
+    BOOST_REQUIRE(it != entry.getNextHops().end());
+    BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
+    BOOST_CHECK_EQUAL(it->getCost(), 30);
+
+    ++it;
+    BOOST_CHECK(it == entry.getNextHops().end());
   }
 
-  entry.removeNextHop(face1);
-  const fib::NextHopList& nexthops6 = entry.getNextHops();
+  entry.removeNextHop(*face1);
   // [(face2,10)]
-  BOOST_CHECK_EQUAL(nexthops6.size(), 1);
-  BOOST_CHECK_EQUAL(nexthops6.begin()->getFace(), face2);
-  BOOST_CHECK_EQUAL(nexthops6.begin()->getCost(), 10);
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getFace().getId(), face2->getId());
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 10);
 
-  entry.removeNextHop(face1);
-  const fib::NextHopList& nexthops7 = entry.getNextHops();
+  entry.removeNextHop(*face1);
   // [(face2,10)]
-  BOOST_CHECK_EQUAL(nexthops7.size(), 1);
-  BOOST_CHECK_EQUAL(nexthops7.begin()->getFace(), face2);
-  BOOST_CHECK_EQUAL(nexthops7.begin()->getCost(), 10);
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getFace().getId(), face2->getId());
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 10);
 
-  entry.removeNextHop(face2);
-  const fib::NextHopList& nexthops8 = entry.getNextHops();
+  entry.removeNextHop(*face2);
   // []
-  BOOST_CHECK_EQUAL(nexthops8.size(), 0);
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 0);
 
-  entry.removeNextHop(face2);
-  const fib::NextHopList& nexthops9 = entry.getNextHops();
+  entry.removeNextHop(*face2);
   // []
-  BOOST_CHECK_EQUAL(nexthops9.size(), 0);
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 0);
 }
 
 BOOST_AUTO_TEST_CASE(Insert_LongestPrefixMatch)
 {
-  Name nameEmpty;
-  Name nameA   ("ndn:/A");
-  Name nameAB  ("ndn:/A/B");
-  Name nameABC ("ndn:/A/B/C");
-  Name nameABCD("ndn:/A/B/C/D");
-  Name nameE   ("ndn:/E");
-
-  std::pair<shared_ptr<fib::Entry>, bool> insertRes;
-  shared_ptr<fib::Entry> entry;
-
   NameTree nameTree;
   Fib fib(nameTree);
+
   // []
   BOOST_CHECK_EQUAL(fib.size(), 0);
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/A").getPrefix(), "/"); // the empty entry
 
-  entry = fib.findLongestPrefixMatch(nameA);
-  BOOST_REQUIRE(static_cast<bool>(entry)); // the empty entry
-
-  insertRes = fib.insert(nameEmpty);
+  std::pair<Entry*, bool> insertRes = fib.insert("/");
   BOOST_CHECK_EQUAL(insertRes.second, true);
-  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameEmpty);
+  BOOST_REQUIRE(insertRes.first != nullptr);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), "/");
   // ['/']
   BOOST_CHECK_EQUAL(fib.size(), 1);
 
-  entry = fib.findLongestPrefixMatch(nameA);
-  BOOST_REQUIRE(static_cast<bool>(entry));
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/A").getPrefix(), "/");
 
-  insertRes = fib.insert(nameA);
+  insertRes = fib.insert("/A");
   BOOST_CHECK_EQUAL(insertRes.second, true);
-  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameA);
+  BOOST_REQUIRE(insertRes.first != nullptr);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), "/A");
   // ['/', '/A']
   BOOST_CHECK_EQUAL(fib.size(), 2);
 
-  insertRes = fib.insert(nameA);
+  insertRes = fib.insert("/A");
   BOOST_CHECK_EQUAL(insertRes.second, false);
-  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameA);
+  BOOST_REQUIRE(insertRes.first != nullptr);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), "/A");
   // ['/', '/A']
   BOOST_CHECK_EQUAL(fib.size(), 2);
 
-  entry = fib.findLongestPrefixMatch(nameA);
-  BOOST_REQUIRE(static_cast<bool>(entry));
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/A").getPrefix(), "/A");
 
-  entry = fib.findLongestPrefixMatch(nameABCD);
-  BOOST_REQUIRE(static_cast<bool>(entry));
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/A/B/C/D").getPrefix(), "/A");
 
-  insertRes = fib.insert(nameABC);
+  insertRes = fib.insert("/A/B/C");
   BOOST_CHECK_EQUAL(insertRes.second, true);
-  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameABC);
+  BOOST_REQUIRE(insertRes.first != nullptr);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), "/A/B/C");
   // ['/', '/A', '/A/B/C']
   BOOST_CHECK_EQUAL(fib.size(), 3);
 
-  entry = fib.findLongestPrefixMatch(nameA);
-  BOOST_REQUIRE(static_cast<bool>(entry));
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
-
-  entry = fib.findLongestPrefixMatch(nameAB);
-  BOOST_REQUIRE(static_cast<bool>(entry));
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
-
-  entry = fib.findLongestPrefixMatch(nameABCD);
-  BOOST_REQUIRE(static_cast<bool>(entry));
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameABC);
-
-  entry = fib.findLongestPrefixMatch(nameE);
-  BOOST_REQUIRE(static_cast<bool>(entry));
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/A").getPrefix(), "/A");
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/A/B").getPrefix(), "/A");
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/A/B/C/D").getPrefix(), "/A/B/C");
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/E").getPrefix(), "/");
 }
 
 BOOST_AUTO_TEST_CASE(LongestPrefixMatchWithPitEntry)
@@ -221,21 +189,13 @@
   shared_ptr<Interest> interestADE = makeInterest(fullNameADE);
   shared_ptr<pit::Entry> pitADE = pit.insert(*interestADE).first;
 
-  size_t nNameTreeEntries = nameTree.size();
+  size_t nNameTreeEntriesBefore = nameTree.size();
 
-  shared_ptr<fib::Entry> entry = fib.findLongestPrefixMatch(*pitAB);
-  BOOST_REQUIRE(entry != nullptr);
-  BOOST_CHECK_EQUAL(entry->getPrefix(), "/A");
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch(*pitAB).getPrefix(), "/A");
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch(*pitABC).getPrefix(), fullNameABC);
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch(*pitADE).getPrefix(), "/A");
 
-  entry = fib.findLongestPrefixMatch(*pitABC);
-  BOOST_REQUIRE(entry != nullptr);
-  BOOST_CHECK_EQUAL(entry->getPrefix(), fullNameABC);
-
-  entry = fib.findLongestPrefixMatch(*pitADE);
-  BOOST_REQUIRE(entry != nullptr);
-  BOOST_CHECK_EQUAL(entry->getPrefix(), "/A");
-
-  BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntries);
+  BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
 }
 
 BOOST_AUTO_TEST_CASE(LongestPrefixMatchWithMeasurementsEntry)
@@ -250,79 +210,57 @@
   shared_ptr<measurements::Entry> mAB = measurements.get("/A/B");
   shared_ptr<measurements::Entry> mABCD = measurements.get("/A/B/C/D");
 
-  shared_ptr<fib::Entry> entry = fib.findLongestPrefixMatch(*mAB);
-  BOOST_REQUIRE(entry != nullptr);
-  BOOST_CHECK_EQUAL(entry->getPrefix(), "/A");
-
-  entry = fib.findLongestPrefixMatch(*mABCD);
-  BOOST_REQUIRE(entry != nullptr);
-  BOOST_CHECK_EQUAL(entry->getPrefix(), "/A/B/C");
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch(*mAB).getPrefix(), "/A");
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch(*mABCD).getPrefix(), "/A/B/C");
 }
 
 BOOST_AUTO_TEST_CASE(RemoveNextHopFromAllEntries)
 {
   shared_ptr<Face> face1 = make_shared<DummyFace>();
   shared_ptr<Face> face2 = make_shared<DummyFace>();
-  Name nameEmpty("ndn:/");
-  Name nameA("ndn:/A");
-  Name nameB("ndn:/B");
-
-  std::pair<shared_ptr<fib::Entry>, bool> insertRes;
-  shared_ptr<fib::Entry> entry;
 
   NameTree nameTree;
   Fib fib(nameTree);
   // {}
 
-  insertRes = fib.insert(nameA);
-  insertRes.first->addNextHop(face1, 0);
-  insertRes.first->addNextHop(face2, 0);
+  Entry* entryA = fib.insert("/A").first;
+  entryA->addNextHop(*face1, 0);
+  entryA->addNextHop(*face2, 0);
   // {'/A':[1,2]}
 
-  insertRes = fib.insert(nameB);
-  insertRes.first->addNextHop(face1, 0);
+  Entry* entryB = fib.insert("/B").first;
+  entryB->addNextHop(*face1, 0);
   // {'/A':[1,2], '/B':[1]}
   BOOST_CHECK_EQUAL(fib.size(), 2);
 
-  insertRes = fib.insert("/C");
-  insertRes.first->addNextHop(face2, 1);
+  Entry* entryC = fib.insert("/C").first;
+  entryC->addNextHop(*face2, 1);
   // {'/A':[1,2], '/B':[1], '/C':[2]}
   BOOST_CHECK_EQUAL(fib.size(), 3);
 
-  insertRes = fib.insert("/B/1");
-  insertRes.first->addNextHop(face1, 0);
+  Entry* entryB1 = fib.insert("/B/1").first;
+  entryB1->addNextHop(*face1, 0);
   // {'/A':[1,2], '/B':[1], '/B/1':[1], '/C':[2]}
   BOOST_CHECK_EQUAL(fib.size(), 4);
 
-  insertRes = fib.insert("/B/1/2");
-  insertRes.first->addNextHop(face1, 0);
+  Entry* entryB12 = fib.insert("/B/1/2").first;
+  entryB12->addNextHop(*face1, 0);
   // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/C':[2]}
   BOOST_CHECK_EQUAL(fib.size(), 5);
 
-  insertRes = fib.insert("/B/1/2/3");
-  insertRes.first->addNextHop(face1, 0);
-  // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/B/1/3':[1], '/C':[2]}
-  BOOST_CHECK_EQUAL(fib.size(), 6);
-
-  insertRes = fib.insert("/B/1/2/3/4");
-  insertRes.first->addNextHop(face1, 0);
-  // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/B/1/2/3':[1], '/B/1/2/3/4':[1], '/C':[2]}
-  BOOST_CHECK_EQUAL(fib.size(), 7);
-
   /////////////
 
-  fib.removeNextHopFromAllEntries(face1);
+  fib.removeNextHopFromAllEntries(*face1);
   // {'/A':[2], '/C':[2]}
   BOOST_CHECK_EQUAL(fib.size(), 2);
 
-  entry = fib.findLongestPrefixMatch(nameA);
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
-  const fib::NextHopList& nexthopsA = entry->getNextHops();
+  const Entry& foundA = fib.findLongestPrefixMatch("/A");
+  BOOST_CHECK_EQUAL(foundA.getPrefix(), "/A");
+  const NextHopList& nexthopsA = foundA.getNextHops();
   BOOST_CHECK_EQUAL(nexthopsA.size(), 1);
-  BOOST_CHECK_EQUAL(nexthopsA.begin()->getFace(), face2);
+  BOOST_CHECK_EQUAL(&nexthopsA.begin()->getFace(), face2.get());
 
-  entry = fib.findLongestPrefixMatch(nameB);
-  BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
+  BOOST_CHECK_EQUAL(fib.findLongestPrefixMatch("/B").getPrefix(), "/");
 }
 
 BOOST_AUTO_TEST_CASE(RemoveNextHopFromManyEntries)
@@ -332,40 +270,32 @@
   shared_ptr<Face> face1 = make_shared<DummyFace>();
 
   for (uint64_t i = 0; i < 300; ++i) {
-    shared_ptr<fib::Entry> entry = fib.insert(Name("/P").appendVersion(i)).first;
-    entry->addNextHop(face1, 0);
+    Entry* entry = fib.insert(Name("/P").appendVersion(i)).first;
+    entry->addNextHop(*face1, 0);
   }
   BOOST_CHECK_EQUAL(fib.size(), 300);
 
-  fib.removeNextHopFromAllEntries(face1);
+  fib.removeNextHopFromAllEntries(*face1);
   BOOST_CHECK_EQUAL(fib.size(), 0);
 }
 
 void
-validateFindExactMatch(const Fib& fib, const Name& target)
+validateFindExactMatch(Fib& fib, const Name& target)
 {
-  shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
-  if (static_cast<bool>(entry))
-    {
-      BOOST_CHECK_EQUAL(entry->getPrefix(), target);
-    }
-  else
-    {
-      BOOST_FAIL("No entry found for " << target);
-    }
+  const Entry* entry = fib.findExactMatch(target);
+  BOOST_REQUIRE_MESSAGE(entry != nullptr, "No entry found for " << target);
+  BOOST_CHECK_EQUAL(entry->getPrefix(), target);
 }
 
 void
-validateNoExactMatch(const Fib& fib, const Name& target)
+validateNoExactMatch(Fib& fib, const Name& target)
 {
-  shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
-  if (static_cast<bool>(entry))
-    {
-      BOOST_FAIL("Found unexpected entry for " << target);
-    }
+  const Entry* entry = fib.findExactMatch(target);
+  BOOST_CHECK_MESSAGE(entry == nullptr,
+                      "Found unexpected entry for " << target);
 }
 
-BOOST_AUTO_TEST_CASE(FindExactMatch)
+BOOST_AUTO_TEST_CASE(ExactMatch)
 {
   NameTree nameTree;
   Fib fib(nameTree);
@@ -376,20 +306,27 @@
   validateFindExactMatch(fib, "/A");
   validateFindExactMatch(fib, "/A/B");
   validateFindExactMatch(fib, "/A/B/C");
+
   validateNoExactMatch(fib, "/");
-
   validateNoExactMatch(fib, "/does/not/exist");
+}
 
-  NameTree gapNameTree;
-  Fib gapFib(nameTree);
+BOOST_AUTO_TEST_CASE(ExactMatchGap)
+{
+  NameTree nameTree;
+  Fib fib(nameTree);
   fib.insert("/X");
   fib.insert("/X/Y/Z");
 
-  validateNoExactMatch(gapFib, "/X/Y");
+  validateNoExactMatch(fib, "/X/Y");
+}
 
-  NameTree emptyNameTree;
-  Fib emptyFib(emptyNameTree);
-  validateNoExactMatch(emptyFib, "/nothing/here");
+BOOST_AUTO_TEST_CASE(ExactMatchEmpty)
+{
+  NameTree nameTree;
+  Fib fib(nameTree);
+  validateNoExactMatch(fib, "/");
+  validateNoExactMatch(fib, "/nothing/here");
 }
 
 void
@@ -397,24 +334,12 @@
 {
   fib.erase(target);
 
-  shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
-  if (static_cast<bool>(entry))
-    {
-      BOOST_FAIL("Found \"removed\" entry for " << target);
-    }
+  const Entry* entry = fib.findExactMatch(target);
+  BOOST_CHECK_MESSAGE(entry == nullptr, "Found \"removed\" entry for " << target);
 }
 
 BOOST_AUTO_TEST_CASE(Erase)
 {
-  NameTree emptyNameTree;
-  Fib emptyFib(emptyNameTree);
-
-  emptyFib.erase("/does/not/exist"); // crash test
-
-  validateErase(emptyFib, "/");
-
-  emptyFib.erase("/still/does/not/exist"); // crash test
-
   NameTree nameTree;
   Fib fib(nameTree);
   fib.insert("/");
@@ -439,15 +364,28 @@
 
   validateErase(fib, "/");
   validateNoExactMatch(fib, "/");
+}
 
-  NameTree gapNameTree;
-  Fib gapFib(gapNameTree);
-  gapFib.insert("/X");
-  gapFib.insert("/X/Y/Z");
+BOOST_AUTO_TEST_CASE(EraseGap)
+{
+  NameTree nameTree;
+  Fib fib(nameTree);
+  fib.insert("/X");
+  fib.insert("/X/Y/Z");
 
-  gapFib.erase("/X/Y"); //should do nothing
-  validateFindExactMatch(gapFib, "/X");
-  validateFindExactMatch(gapFib, "/X/Y/Z");
+  fib.erase("/X/Y"); //should do nothing
+  validateFindExactMatch(fib, "/X");
+  validateFindExactMatch(fib, "/X/Y/Z");
+}
+
+BOOST_AUTO_TEST_CASE(EraseEmpty)
+{
+  NameTree nameTree;
+  Fib fib(nameTree);
+
+  BOOST_CHECK_NO_THROW(fib.erase("/does/not/exist"));
+  validateErase(fib, "/");
+  BOOST_CHECK_NO_THROW(fib.erase("/still/does/not/exist"));
 }
 
 BOOST_AUTO_TEST_CASE(EraseNameTreeEntry)
@@ -456,8 +394,8 @@
   Fib fib(nameTree);
   size_t nNameTreeEntriesBefore = nameTree.size();
 
-  fib.insert("ndn:/A/B/C");
-  fib.erase("ndn:/A/B/C");
+  fib.insert("/A/B/C");
+  fib.erase("/A/B/C");
   BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
 }
 
@@ -475,11 +413,7 @@
   fib.insert(nameABC);
   fib.insert(nameRoot);
 
-  std::set<Name> expected;
-  expected.insert(nameA);
-  expected.insert(nameAB);
-  expected.insert(nameABC);
-  expected.insert(nameRoot);
+  std::set<Name> expected{nameA, nameAB, nameABC, nameRoot};
 
   for (Fib::const_iterator it = fib.begin(); it != fib.end(); it++) {
     bool isInSet = expected.find(it->getPrefix()) != expected.end();
@@ -494,4 +428,5 @@
 BOOST_AUTO_TEST_SUITE_END() // Table
 
 } // namespace tests
+} // namespace fib
 } // namespace nfd
diff --git a/tests/daemon/table/measurements.t.cpp b/tests/daemon/table/measurements.t.cpp
index bbf1903..c8b2e27 100644
--- a/tests/daemon/table/measurements.t.cpp
+++ b/tests/daemon/table/measurements.t.cpp
@@ -70,8 +70,8 @@
 {
   Fib fib(nameTree);
 
-  shared_ptr<fib::Entry> fibA = fib.insert("/A").first;
-  shared_ptr<fib::Entry> fibAB = fib.insert("/A/B").first;
+  const fib::Entry* fibA = fib.insert("/A").first;
+  const fib::Entry* fibAB = fib.insert("/A/B").first;
 
   shared_ptr<measurements::Entry> entryA = measurements.get(*fibA);
   BOOST_REQUIRE(entryA != nullptr);
@@ -86,9 +86,9 @@
 {
   Fib fib(nameTree);
 
-  shared_ptr<fib::Entry> fib0 = fib.findLongestPrefixMatch("/");
+  const fib::Entry& fib0 = fib.findLongestPrefixMatch("/");
 
-  shared_ptr<measurements::Entry> entry0 = measurements.get(*fib0);
+  shared_ptr<measurements::Entry> entry0 = measurements.get(fib0);
   BOOST_REQUIRE(entry0 != nullptr);
   BOOST_CHECK_EQUAL(entry0->getName(), "/");
 }
diff --git a/tests/daemon/table/name-tree.t.cpp b/tests/daemon/table/name-tree.t.cpp
index 2a5bd40..a79e2d5 100644
--- a/tests/daemon/table/name-tree.t.cpp
+++ b/tests/daemon/table/name-tree.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -66,8 +66,8 @@
   std::vector<shared_ptr<name_tree::Entry> >& childList = npe->getChildren();
   BOOST_CHECK_EQUAL(childList.size(), static_cast<size_t>(0));
 
-  shared_ptr<fib::Entry> fib = npe->getFibEntry();
-  BOOST_CHECK(!static_cast<bool>(fib));
+  fib::Entry* fib = npe->getFibEntry();
+  BOOST_CHECK(fib == nullptr);
 
   const std::vector< shared_ptr<pit::Entry> >& pitList = npe->getPitEntries();
   BOOST_CHECK_EQUAL(pitList.size(), static_cast<size_t>(0));
@@ -84,14 +84,12 @@
 
   // Insert FIB
 
-  shared_ptr<fib::Entry> fibEntry(new fib::Entry(prefix));
-  shared_ptr<fib::Entry> fibEntryParent(new fib::Entry(parentName));
+  npe->setFibEntry(make_unique<fib::Entry>(prefix));
+  BOOST_REQUIRE(npe->getFibEntry() != nullptr);
+  BOOST_CHECK_EQUAL(npe->getFibEntry()->getPrefix(), prefix);
 
-  npe->setFibEntry(fibEntry);
-  BOOST_CHECK_EQUAL(npe->getFibEntry(), fibEntry);
-
-  npe->setFibEntry(shared_ptr<fib::Entry>());
-  BOOST_CHECK(!static_cast<bool>(npe->getFibEntry()));
+  npe->setFibEntry(nullptr);
+  BOOST_CHECK(npe->getFibEntry() == nullptr);
 
   // Insert a PIT
 
