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;
 }
 
