diff --git a/daemon/rib/rib-entry.cpp b/daemon/rib/rib-entry.cpp
index 1df227e..29c9eb7 100644
--- a/daemon/rib/rib-entry.cpp
+++ b/daemon/rib/rib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -72,35 +72,20 @@
 void
 RibEntry::eraseRoute(const Route& route)
 {
-  auto it = findRoute(route);
-  eraseRoute(it);
-}
-
-bool
-RibEntry::hasRoute(const Route& route)
-{
-  auto it = findRoute(route);
-  return it != end();
+  eraseRoute(findRoute(route));
 }
 
 bool
 RibEntry::hasFaceId(uint64_t faceId) const
 {
-  auto it = std::find_if(begin(), end(), [faceId] (const auto& r) { return r.faceId == faceId; });
-  return it != end();
-}
-
-size_t
-RibEntry::getNRoutes() const
-{
-  return m_routes.size();
+  return std::find_if(begin(), end(), [=] (const auto& r) { return r.faceId == faceId; }) != end();
 }
 
 void
 RibEntry::addChild(shared_ptr<RibEntry> child)
 {
   BOOST_ASSERT(!child->getParent());
-  child->setParent(this->shared_from_this());
+  child->m_parent = shared_from_this();
   m_children.push_back(std::move(child));
 }
 
@@ -108,7 +93,7 @@
 RibEntry::removeChild(shared_ptr<RibEntry> child)
 {
   BOOST_ASSERT(child->getParent().get() == this);
-  child->setParent(nullptr);
+  child->m_parent = nullptr;
   m_children.remove(child);
 }
 
@@ -156,12 +141,6 @@
 }
 
 bool
-RibEntry::hasCapture() const
-{
-  return m_nRoutesWithCaptureSet > 0;
-}
-
-bool
 RibEntry::hasChildInheritOnFaceId(uint64_t faceId) const
 {
   for (const Route& route : m_routes) {
