diff --git a/rib/rib.cpp b/rib/rib.cpp
index eb577bb..97492b2 100644
--- a/rib/rib.cpp
+++ b/rib/rib.cpp
@@ -89,42 +89,45 @@
   if (ribIt != m_rib.end()) {
     shared_ptr<RibEntry> entry(ribIt->second);
 
-    RibEntry::iterator routeIt = entry->findRoute(route);
+    RibEntry::iterator entryIt;
+    bool didInsert = false;
+    std::tie(entryIt, didInsert) = entry->insertRoute(route);
 
-    if (routeIt == entry->end()) {
-      // New route
-      entry->insertRoute(route);
+    if (didInsert) {
+      // The route was new and we successfully inserted it.
       m_nItems++;
 
+      afterAddRoute(RibRouteRef{entry, entryIt});
+
       // Register with face lookup table
       m_faceMap[route.faceId].push_back(entry);
     }
     else {
       // Route exists, update fields
       // First cancel old scheduled event, if any, then set the EventId to new one
-      if (static_cast<bool>(routeIt->getExpirationEvent())) {
+      if (static_cast<bool>(entryIt->getExpirationEvent())) {
         NFD_LOG_TRACE("Cancelling expiration event for " << entry->getName() << " "
-                                                         << *routeIt);
-        scheduler::cancel(routeIt->getExpirationEvent());
+                                                         << (*entryIt));
+        scheduler::cancel(entryIt->getExpirationEvent());
       }
 
       // No checks are required here as the iterator needs to be updated in all cases.
-      routeIt->setExpirationEvent(route.getExpirationEvent());
+      entryIt->setExpirationEvent(route.getExpirationEvent());
 
-      routeIt->flags = route.flags;
-      routeIt->cost = route.cost;
-      routeIt->expires = route.expires;
+      entryIt->flags = route.flags;
+      entryIt->cost = route.cost;
+      entryIt->expires = route.expires;
     }
   }
   else {
     // New name prefix
-    shared_ptr<RibEntry> entry(make_shared<RibEntry>(RibEntry()));
+    shared_ptr<RibEntry> entry = make_shared<RibEntry>();
 
     m_rib[prefix] = entry;
     m_nItems++;
 
     entry->setName(prefix);
-    entry->insertRoute(route);
+    RibEntry::iterator routeIt = entry->insertRoute(route).first;
 
     // Find prefix's parent
     shared_ptr<RibEntry> parent = findParent(prefix);
@@ -152,6 +155,7 @@
 
     // do something after inserting an entry
     afterInsertEntry(prefix);
+    afterAddRoute(RibRouteRef{entry, routeIt});
   }
 }
 
@@ -166,6 +170,8 @@
     RibEntry::iterator routeIt = entry->findRoute(route);
 
     if (routeIt != entry->end()) {
+      beforeRemoveRoute(RibRouteRef{entry, routeIt});
+
       auto faceId = route.faceId;
       entry->eraseRoute(routeIt);
       m_nItems--;
