diff --git a/daemon/table/cleanup.cpp b/daemon/table/cleanup.cpp
index d45b363..a62304b 100644
--- a/daemon/table/cleanup.cpp
+++ b/daemon/table/cleanup.cpp
@@ -36,7 +36,7 @@
   for (const name_tree::Entry& nte : nt) {
     fib::Entry* fibEntry = nte.getFibEntry();
     if (fibEntry != nullptr) {
-      fib.removeNextHopByFace(*fibEntry, face);
+      fib.removeNextHop(*fibEntry, face);
     }
 
     for (const auto& pitEntry : nte.getPitEntries()) {
diff --git a/daemon/table/fib-entry.cpp b/daemon/table/fib-entry.cpp
index bb49979..ff5c125 100644
--- a/daemon/table/fib-entry.cpp
+++ b/daemon/table/fib-entry.cpp
@@ -34,52 +34,43 @@
 }
 
 NextHopList::iterator
-Entry::findNextHop(const Face& face, EndpointId endpointId)
+Entry::findNextHop(const Face& face)
 {
   return std::find_if(m_nextHops.begin(), m_nextHops.end(),
-                      [&face, endpointId] (const NextHop& nexthop) {
-                        return &nexthop.getFace() == &face && nexthop.getEndpointId() == endpointId;
+                      [&face] (const NextHop& nexthop) {
+                        return &nexthop.getFace() == &face;
                       });
 }
 
 bool
-Entry::hasNextHop(const Face& face, EndpointId endpointId) const
+Entry::hasNextHop(const Face& face) const
 {
-  return const_cast<Entry*>(this)->findNextHop(face, endpointId) != m_nextHops.end();
+  return const_cast<Entry*>(this)->findNextHop(face) != m_nextHops.end();
 }
 
 void
-Entry::addOrUpdateNextHop(Face& face, EndpointId endpointId, uint64_t cost)
+Entry::addOrUpdateNextHop(Face& face, uint64_t cost)
 {
-  auto it = this->findNextHop(face, endpointId);
+  auto it = this->findNextHop(face);
   if (it == m_nextHops.end()) {
-    m_nextHops.emplace_back(face, endpointId);
+    m_nextHops.emplace_back(face);
     it = std::prev(m_nextHops.end());
   }
+
   it->setCost(cost);
   this->sortNextHops();
 }
 
 void
-Entry::removeNextHop(const Face& face, EndpointId endpointId)
+Entry::removeNextHop(const Face& face)
 {
-  auto it = this->findNextHop(face, endpointId);
+  auto it = this->findNextHop(face);
   if (it != m_nextHops.end()) {
     m_nextHops.erase(it);
   }
 }
 
 void
-Entry::removeNextHopByFace(const Face& face)
-{
-  auto it = std::remove_if(m_nextHops.begin(), m_nextHops.end(),
-                           [&face] (const NextHop& nexthop) {
-                             return &nexthop.getFace() == &face;
-                           });
-  m_nextHops.erase(it, m_nextHops.end());
-}
-
-void
 Entry::sortNextHops()
 {
   std::sort(m_nextHops.begin(), m_nextHops.end(),
diff --git a/daemon/table/fib-entry.hpp b/daemon/table/fib-entry.hpp
index e0edcc0..52dfbd8 100644
--- a/daemon/table/fib-entry.hpp
+++ b/daemon/table/fib-entry.hpp
@@ -74,36 +74,32 @@
     return !m_nextHops.empty();
   }
 
-  /** \return whether there is a NextHop record for \p face with the given \p endpointId
+  /** \return whether there is a NextHop record for \p face
    */
   bool
-  hasNextHop(const Face& face, EndpointId endpointId) const;
+  hasNextHop(const Face& face) const;
 
   /** \brief adds a NextHop record
    *
-   *  If a NextHop record for \p face and \p endpointId already exists,
-   *  its cost is updated.
+   *  If a NextHop record for \p face already exists, its cost is updated.
    */
   void
-  addOrUpdateNextHop(Face& face, EndpointId endpointId, uint64_t cost);
+  addOrUpdateNextHop(Face& face, uint64_t cost);
 
-  /** \brief removes the NextHop record for \p face with the given \p endpointId
+  /** \brief removes a NextHop record
+   *
+   *  If no NextHop record for face exists, do nothing.
    */
   void
-  removeNextHop(const Face& face, EndpointId endpointId);
-
-  /** \brief removes all NextHop records on \p face for any \p endpointId
-   */
-  void
-  removeNextHopByFace(const Face& face);
+  removeNextHop(const Face& face);
 
 private:
   /** \note This method is non-const because mutable iterators are needed by callers.
    */
   NextHopList::iterator
-  findNextHop(const Face& face, EndpointId endpointId);
+  findNextHop(const Face& face);
 
-  /** \brief sorts the nexthop list by cost
+  /** \brief sorts the nexthop list
    */
   void
   sortNextHops();
diff --git a/daemon/table/fib-nexthop.hpp b/daemon/table/fib-nexthop.hpp
index 80609ba..e03efda 100644
--- a/daemon/table/fib-nexthop.hpp
+++ b/daemon/table/fib-nexthop.hpp
@@ -37,9 +37,9 @@
 class NextHop
 {
 public:
-  NextHop(Face& face, EndpointId endpointId)
+  explicit
+  NextHop(Face& face)
     : m_face(&face)
-    , m_endpointId(endpointId)
   {
   }
 
@@ -49,12 +49,6 @@
     return *m_face;
   }
 
-  EndpointId
-  getEndpointId() const
-  {
-    return m_endpointId;
-  }
-
   uint64_t
   getCost() const
   {
@@ -69,7 +63,6 @@
 
 private:
   Face* m_face; // pointer instead of reference so that NextHop is movable
-  EndpointId m_endpointId;
   uint64_t m_cost = 0;
 };
 
diff --git a/daemon/table/fib.cpp b/daemon/table/fib.cpp
index 2f3deab..62938e0 100644
--- a/daemon/table/fib.cpp
+++ b/daemon/table/fib.cpp
@@ -133,28 +133,16 @@
 }
 
 void
-Fib::eraseIfEmpty(Entry& entry)
+Fib::removeNextHop(Entry& entry, const Face& face)
 {
+  entry.removeNextHop(face);
+
   if (!entry.hasNextHops()) {
     name_tree::Entry* nte = m_nameTree.getEntry(entry);
     this->erase(nte, false);
   }
 }
 
-void
-Fib::removeNextHop(Entry& entry, const Face& face, EndpointId endpointId)
-{
-  entry.removeNextHop(face, endpointId);
-  this->eraseIfEmpty(entry);
-}
-
-void
-Fib::removeNextHopByFace(Entry& entry, const Face& face)
-{
-  entry.removeNextHopByFace(face);
-  this->eraseIfEmpty(entry);
-}
-
 Fib::Range
 Fib::getRange() const
 {
diff --git a/daemon/table/fib.hpp b/daemon/table/fib.hpp
index 462a29b..8543440 100644
--- a/daemon/table/fib.hpp
+++ b/daemon/table/fib.hpp
@@ -103,15 +103,10 @@
   void
   erase(const Entry& entry);
 
-  /** \brief Remove the NextHop record for the given \p face and \p endpointId
+  /** \brief Remove the NextHop record for \p face
    */
   void
-  removeNextHop(Entry& entry, const Face& face, EndpointId endpointId);
-
-  /** \brief Remove all NextHop records for \p face
-   */
-  void
-  removeNextHopByFace(Entry& entry, const Face& face);
+  removeNextHop(Entry& entry, const Face& face);
 
 public: // enumeration
   typedef boost::transformed_range<name_tree::GetTableEntry<Entry>, const name_tree::Range> Range;
@@ -147,11 +142,6 @@
   void
   erase(name_tree::Entry* nte, bool canDeleteNte = true);
 
-  /** \brief Erase \p entry if it contains no nexthop records
-   */
-  void
-  eraseIfEmpty(Entry& entry);
-
   Range
   getRange() const;
 
