diff --git a/rib/fib-updater.cpp b/rib/fib-updater.cpp
index 212bccf..839e5ea 100644
--- a/rib/fib-updater.cpp
+++ b/rib/fib-updater.cpp
@@ -424,15 +424,14 @@
                                         bool captureWasTurnedOn)
 {
   // Only update if the new route has a lower cost than a previously installed route
-  shared_ptr<const Route> prevRoute =
-    entry.getRouteWithLowestCostAndChildInheritByFaceId(route.faceId);
+  const Route* prevRoute = entry.getRouteWithLowestCostAndChildInheritByFaceId(route.faceId);
 
   Rib::RouteSet routesToAdd;
   if (route.isChildInherit()) {
     // Add to children if this new route doesn't override a previous lower cost, or
     // add to children if this new route is lower cost than a previous route.
     // Less than equal, since entry may find this route
-    if (!static_cast<bool>(prevRoute) || route.cost <= prevRoute->cost) {
+    if (prevRoute == nullptr || route.cost <= prevRoute->cost) {
       // Add self to children
       routesToAdd.insert(route);
     }
@@ -452,9 +451,9 @@
   // If another route with same faceId and lower cost exists, don't update.
   // Must be done last so that add updates replace removal updates
   // Create FIB update for new entry
-  shared_ptr<const Route> other = entry.getRouteWithLowestCostByFaceId(route.faceId);
+  const Route* other = entry.getRouteWithLowestCostByFaceId(route.faceId);
 
-  if (!other || route.cost <= other->cost) {
+  if (other == nullptr || route.cost <= other->cost) {
     addFibUpdate(FibUpdate::createAddUpdate(entry.getName(), route.faceId, route.cost));
   }
 }
@@ -466,8 +465,7 @@
   const bool costDidChange = (route.cost != existingRoute.cost);
 
   // Look for an installed route with the lowest cost and child inherit set
-  shared_ptr<const Route> prevRoute =
-    entry.getRouteWithLowestCostAndChildInheritByFaceId(route.faceId);
+  const Route* prevRoute = entry.getRouteWithLowestCostAndChildInheritByFaceId(route.faceId);
 
   // No flags changed and cost didn't change, no change in FIB
   if (route.flags == existingRoute.flags && !costDidChange) {
@@ -489,7 +487,7 @@
 
     // If another route with same faceId and lower cost and ChildInherit exists,
     // don't update children.
-    if (!static_cast<bool>(prevRoute) || route.cost <= prevRoute->cost) {
+    if (prevRoute == nullptr || route.cost <= prevRoute->cost) {
       // If no flags changed but child inheritance is set, need to update children
       // with new cost
       if ((route.flags == existingRoute.flags) && route.isChildInherit()) {
@@ -507,7 +505,7 @@
   if (!existingRoute.isChildInherit() && route.isChildInherit()) {
     // If another route with same faceId and lower cost and ChildInherit exists,
     // don't update children.
-    if (!static_cast<bool>(prevRoute) || route.cost <= prevRoute->cost) {
+    if (prevRoute == nullptr || route.cost <= prevRoute->cost) {
       // Add self to children
       Rib::RouteSet routesToAdd;
       routesToAdd.insert(route);
@@ -521,7 +519,7 @@
 
     Rib::RouteSet routesToAdd;
     // If another route with same faceId and ChildInherit exists, update children with this route.
-    if (static_cast<bool>(prevRoute)) {
+    if (prevRoute != nullptr) {
       routesToAdd.insert(*prevRoute);
     }
     else {
diff --git a/rib/rib-entry.cpp b/rib/rib-entry.cpp
index 22b6dee..39c27d0 100644
--- a/rib/rib-entry.cpp
+++ b/rib/rib-entry.cpp
@@ -175,21 +175,21 @@
   return false;
 }
 
-shared_ptr<const Route>
+const Route*
 RibEntry::getRouteWithLowestCostByFaceId(uint64_t faceId) const
 {
-  shared_ptr<Route> candidate;
+  const Route* candidate = nullptr;
 
   for (const Route& route : m_routes) {
     // Matching face ID
     if (route.faceId == faceId) {
       // If this is the first route with this Face ID found
       if (candidate == nullptr) {
-        candidate = make_shared<Route>(route);
+        candidate = &route;
       }
       else if (route.cost < candidate->cost) {
         // Found a route with a lower cost
-        candidate = make_shared<Route>(route);
+        candidate = &route;
       }
     }
   }
@@ -218,10 +218,10 @@
   return &matches.at(1);
 }
 
-shared_ptr<const Route>
+const Route*
 RibEntry::getRouteWithLowestCostAndChildInheritByFaceId(uint64_t faceId) const
 {
-  shared_ptr<Route> candidate;
+  const Route* candidate = nullptr;
 
   for (const Route& route : m_routes) {
     // Correct face ID and Child Inherit flag set
@@ -230,11 +230,11 @@
     {
       // If this is the first route with this Face ID found
       if (candidate == nullptr) {
-        candidate = make_shared<Route>(route);
+        candidate = &route;
       }
       else if (route.cost < candidate->cost) {
         // Found a route with a lower cost
-        candidate = make_shared<Route>(route);
+        candidate = &route;
       }
     }
   }
diff --git a/rib/rib-entry.hpp b/rib/rib-entry.hpp
index c3efbb7..52f070f 100644
--- a/rib/rib-entry.hpp
+++ b/rib/rib-entry.hpp
@@ -146,10 +146,10 @@
   /** \brief Returns the route with the lowest cost that has the passed face ID.
    *  \return{ The route with the lowest cost that has the passed face ID}
    */
-  shared_ptr<const Route>
+  const Route*
   getRouteWithLowestCostByFaceId(uint64_t faceId) const;
 
-const Route*
+  const Route*
   getRouteWithSecondLowestCostByFaceId(uint64_t faceId) const;
 
   /** \brief Returns the route with the lowest cost that has the passed face ID
@@ -157,7 +157,7 @@
    *  \return{ The route with the lowest cost that has the passed face ID
    *           and its child inherit flag set }
    */
-  shared_ptr<const Route>
+  const Route*
   getRouteWithLowestCostAndChildInheritByFaceId(uint64_t faceId) const;
 
   const_iterator
