diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index 41f9925..f05ca46 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -131,41 +131,29 @@
 }
 
 void
-RibManager::beginAddRoute(const Name& name, Route route, std::optional<time::nanoseconds> expires,
-                          const std::function<void(RibUpdateResult)>& done)
+RibManager::addRoute(const Name& name, Route route, const time::steady_clock::time_point& now,
+                     const std::function<void(RibUpdateResult)>& done)
 {
-  if (expires) {
-    route.expires = time::steady_clock::now() + *expires;
-  }
-  else if (route.expires) {
-    expires = *route.expires - time::steady_clock::now();
-  }
-
-  if (expires && *expires <= 0_s) {
+  if (route.expires && *route.expires <= now) {
     m_rib.onRouteExpiration(name, route);
-    return done(RibUpdateResult::EXPIRED);
+    if (done) {
+      done(RibUpdateResult::EXPIRED);
+    }
+    return;
   }
 
   NFD_LOG_INFO("Adding route " << name << " nexthop=" << route.faceId <<
                " origin=" << route.origin << " cost=" << route.cost);
 
-  if (expires) {
-    auto event = getScheduler().schedule(*expires, [=] { m_rib.onRouteExpiration(name, route); });
-    route.setExpirationEvent(event);
-    NFD_LOG_TRACE("Scheduled unregistration at: " << *route.expires);
+  if (route.expires) {
+    auto delay = *route.expires - now;
+    auto event = getScheduler().schedule(delay, [=] { m_rib.onRouteExpiration(name, route); });
+    route.setExpirationEvent(std::move(event));
+    // cast to milliseconds to make the logs easier to read
+    NFD_LOG_TRACE("Route will expire in " << time::duration_cast<time::milliseconds>(delay));
   }
 
-  beginRibUpdate({rib::RibUpdate::REGISTER, name, route}, done);
-}
-
-void
-RibManager::beginRemoveRoute(const Name& name, const Route& route,
-                             const std::function<void(RibUpdateResult)>& done)
-{
-  NFD_LOG_INFO("Removing route " << name << " nexthop=" << route.faceId <<
-               " origin=" << route.origin);
-
-  beginRibUpdate({rib::RibUpdate::UNREGISTER, name, route}, done);
+  beginRibUpdate({rib::RibUpdate::REGISTER, name, std::move(route)}, done);
 }
 
 void
@@ -175,7 +163,9 @@
   m_rib.beginApplyUpdate(update,
     [=] {
       NFD_LOG_DEBUG(update << " -> OK");
-      done(RibUpdateResult::OK);
+      if (done) {
+        done(RibUpdateResult::OK);
+      }
     },
     [=] (uint32_t code, const std::string& error) {
       NFD_LOG_DEBUG(update << " -> error " << code << ": " << error);
@@ -183,7 +173,9 @@
       // Since the FIB rejected the update, clean up invalid routes
       scheduleActiveFaceFetch(1_s);
 
-      done(RibUpdateResult::ERROR);
+      if (done) {
+        done(RibUpdateResult::ERROR);
+      }
     });
 }
 
@@ -247,13 +239,13 @@
   route.cost = parameters.getCost();
   route.flags = parameters.getFlags();
 
-  std::optional<time::nanoseconds> expires;
+  auto now = time::steady_clock::now();
   if (parameters.hasExpirationPeriod() &&
       parameters.getExpirationPeriod() != time::milliseconds::max()) {
-    expires = time::duration_cast<time::nanoseconds>(parameters.getExpirationPeriod());
+    route.expires = now + parameters.getExpirationPeriod();
   }
 
-  beginAddRoute(parameters.getName(), std::move(route), expires, [] (RibUpdateResult) {});
+  addRoute(parameters.getName(), std::move(route), now);
 }
 
 void
@@ -271,7 +263,10 @@
   route.faceId = parameters.getFaceId();
   route.origin = parameters.getOrigin();
 
-  beginRemoveRoute(parameters.getName(), route, [] (auto&&...) {});
+  NFD_LOG_INFO("Removing route " << parameters.getName() <<
+               " nexthop=" << route.faceId << " origin=" << route.origin);
+
+  beginRibUpdate({rib::RibUpdate::UNREGISTER, parameters.getName(), route}, nullptr);
 }
 
 void
@@ -286,25 +281,28 @@
     return;
   }
 
-  Route route(announcement, getIncomingFaceId(interest));
-
-  // Prepare parameters for response
-  ControlParameters responseParams;
-  responseParams
-    .setName(name)
-    .setFaceId(route.faceId)
-    .setOrigin(route.origin)
-    .setCost(route.cost)
-    .setFlags(route.flags)
-    .setExpirationPeriod(time::duration_cast<time::milliseconds>(route.annExpires - time::steady_clock::now()));
+  auto inFaceId = getIncomingFaceId(interest);
 
   NDN_LOG_TRACE("Validating announcement " << announcement);
   BOOST_ASSERT(announcement.getData());
   m_paValidator.validate(*announcement.getData(),
-    [=, route = std::move(route)] (const Data&) {
+    [=] (const Data&) {
+      auto now = time::steady_clock::now();
+      Route route(announcement, inFaceId);
+
+      // Prepare parameters for response
+      ControlParameters responseParams;
+      responseParams
+        .setName(announcement.getAnnouncedName())
+        .setFaceId(route.faceId)
+        .setOrigin(route.origin)
+        .setCost(route.cost)
+        .setFlags(route.flags)
+        .setExpirationPeriod(time::duration_cast<time::milliseconds>(route.annExpires - now));
+
       // Respond since command is valid and authorized
       done(ControlResponse(200, "OK").setBody(responseParams.wireEncode()));
-      beginAddRoute(name, std::move(route), std::nullopt, [] (RibUpdateResult) {});
+      addRoute(announcement.getAnnouncedName(), std::move(route), now);
     },
     [=] (const Data&, const ndn::security::ValidationError& err) {
       NDN_LOG_DEBUG("announce " << name << " -> " << err);
@@ -314,7 +312,7 @@
 }
 
 void
-RibManager::listEntries(ndn::mgmt::StatusDatasetContext& context)
+RibManager::listEntries(ndn::mgmt::StatusDatasetContext& context) const
 {
   auto now = time::steady_clock::now();
   for (const auto& kv : m_rib) {
@@ -396,14 +394,14 @@
 
   m_paValidator.validate(*pa.getData(),
     [=] (const Data&) {
+      auto now = time::steady_clock::now();
       Route route(pa, faceId);
-      route.expires = std::min(route.annExpires, time::steady_clock::now() + maxLifetime);
-      beginAddRoute(pa.getAnnouncedName(), route, std::nullopt,
-        [=] (RibUpdateResult ribRes) {
-          auto res = getSlAnnounceResultFromRibUpdateResult(ribRes);
-          NFD_LOG_INFO("slAnnounce " << pa.getAnnouncedName() << " " << faceId << " -> " << res);
-          cb(res);
-        });
+      route.expires = std::min(route.annExpires, now + maxLifetime);
+      addRoute(pa.getAnnouncedName(), std::move(route), now, [=] (RibUpdateResult ribRes) {
+        auto res = getSlAnnounceResultFromRibUpdateResult(ribRes);
+        NFD_LOG_INFO("slAnnounce " << pa.getAnnouncedName() << " " << faceId << " -> " << res);
+        cb(res);
+      });
     },
     [=] (const Data&, const ndn::security::ValidationError& err) {
       NFD_LOG_INFO("slAnnounce " << pa.getAnnouncedName() << " " << faceId <<
@@ -425,16 +423,17 @@
     NFD_LOG_DEBUG("slRenew " << name << " " << faceId << " -> not found");
     return cb(SlAnnounceResult::NOT_FOUND);
   }
-  Name routeName = oldRoute->announcement->getAnnouncedName();
 
+  auto now = time::steady_clock::now();
+  Name routeName = oldRoute->announcement->getAnnouncedName();
   Route route = *oldRoute;
-  route.expires = std::min(route.annExpires, time::steady_clock::now() + maxLifetime);
-  beginAddRoute(routeName, route, std::nullopt,
-    [=] (RibUpdateResult ribRes) {
-      auto res = getSlAnnounceResultFromRibUpdateResult(ribRes);
-      NFD_LOG_INFO("slRenew " << name << " " << faceId << " -> " << res << " " << routeName);
-      cb(res);
-    });
+  route.expires = std::min(route.annExpires, now + maxLifetime);
+
+  addRoute(routeName, std::move(route), now, [=] (RibUpdateResult ribRes) {
+    auto res = getSlAnnounceResultFromRibUpdateResult(ribRes);
+    NFD_LOG_INFO("slRenew " << name << " " << faceId << " -> " << res << " " << routeName);
+    cb(res);
+  });
 }
 
 void
diff --git a/daemon/mgmt/rib-manager.hpp b/daemon/mgmt/rib-manager.hpp
index d6b6ebe..bcdd42a 100644
--- a/daemon/mgmt/rib-manager.hpp
+++ b/daemon/mgmt/rib-manager.hpp
@@ -159,7 +159,7 @@
   void
   slFindAnn(const Name& name, const SlFindAnnCallback& cb) const;
 
-private: // RIB and FibUpdater actions
+private: // RIB update actions
   enum class RibUpdateResult
   {
     OK,
@@ -170,24 +170,12 @@
   static SlAnnounceResult
   getSlAnnounceResultFromRibUpdateResult(RibUpdateResult r);
 
-  /** \brief Start adding a route to RIB and FIB.
-   *  \param name route name
-   *  \param route route parameters; may contain absolute expiration time
-   *  \param expires relative expiration time; if specified, overwrites \c route.expires
-   *  \param done completion callback
+  /**
+   * \brief Start adding a route to RIB and FIB.
    */
   void
-  beginAddRoute(const Name& name, rib::Route route, std::optional<time::nanoseconds> expires,
-                const std::function<void(RibUpdateResult)>& done);
-
-  /** \brief Start removing a route from RIB and FIB.
-   *  \param name route name
-   *  \param route route parameters
-   *  \param done completion callback
-   */
-  void
-  beginRemoveRoute(const Name& name, const rib::Route& route,
-                   const std::function<void(RibUpdateResult)>& done);
+  addRoute(const Name& name, rib::Route route, const time::steady_clock::time_point& now,
+           const std::function<void(RibUpdateResult)>& done = nullptr);
 
   void
   beginRibUpdate(const rib::RibUpdate& update,
@@ -222,7 +210,7 @@
    * \brief Serve `rib/list` dataset.
    */
   void
-  listEntries(ndn::mgmt::StatusDatasetContext& context);
+  listEntries(ndn::mgmt::StatusDatasetContext& context) const;
 
   ndn::mgmt::Authorization
   makeAuthorization(const std::string& verb) final;
diff --git a/daemon/rib/route.hpp b/daemon/rib/route.hpp
index 43f520d..6654532 100644
--- a/daemon/rib/route.hpp
+++ b/daemon/rib/route.hpp
@@ -60,9 +60,9 @@
   }
 
   void
-  setExpirationEvent(const ndn::scheduler::EventId& eid)
+  setExpirationEvent(ndn::scheduler::EventId&& eid)
   {
-    m_expirationEvent = eid;
+    m_expirationEvent = std::move(eid);
   }
 
   void
