diff --git a/daemon/rib/rib-entry.cpp b/daemon/rib/rib-entry.cpp
index 7385d16..6acae09 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-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -33,22 +33,30 @@
 
 NFD_LOG_INIT(RibEntry);
 
+static bool
+compareFaceIdAndOrigin(const Route& lhs, const Route& rhs)
+{
+  return lhs.faceId == rhs.faceId && lhs.origin == rhs.origin;
+}
+
 RibEntry::RouteList::iterator
 RibEntry::findRoute(const Route& route)
 {
-  return std::find_if(begin(), end(), bind(&compareFaceIdAndOrigin, _1, route));
+  return std::find_if(begin(), end(),
+                      [&] (const auto& r) { return compareFaceIdAndOrigin(r, route); });
 }
 
 RibEntry::RouteList::const_iterator
 RibEntry::findRoute(const Route& route) const
 {
-  return std::find_if(begin(), end(), bind(&compareFaceIdAndOrigin, _1, route));
+  return std::find_if(begin(), end(),
+                      [&] (const auto& r) { return compareFaceIdAndOrigin(r, route); });
 }
 
 std::pair<RibEntry::iterator, bool>
 RibEntry::insertRoute(const Route& route)
 {
-  iterator it = findRoute(route);
+  auto it = findRoute(route);
 
   if (it == end()) {
     if (route.flags & ndn::nfd::ROUTE_FLAG_CAPTURE) {
@@ -65,23 +73,21 @@
 void
 RibEntry::eraseRoute(const Route& route)
 {
-  RibEntry::iterator it = findRoute(route);
+  auto it = findRoute(route);
   eraseRoute(it);
 }
 
 bool
 RibEntry::hasRoute(const Route& route)
 {
-  RibEntry::const_iterator it = findRoute(route);
-
+  auto it = findRoute(route);
   return it != end();
 }
 
 bool
-RibEntry::hasFaceId(const uint64_t faceId) const
+RibEntry::hasFaceId(uint64_t faceId) const
 {
-  RibEntry::const_iterator it = std::find_if(begin(), end(), bind(&compareFaceId, _1, faceId));
-
+  auto it = std::find_if(begin(), end(), [faceId] (const auto& r) { return r.faceId == faceId; });
   return it != end();
 }
 
@@ -134,14 +140,14 @@
 void
 RibEntry::removeInheritedRoute(const Route& route)
 {
-  m_inheritedRoutes.remove_if(bind(&compareFaceId, _1, route.faceId));
+  m_inheritedRoutes.remove_if([id = route.faceId] (const auto& r) { return r.faceId == id; });
 }
 
 RibEntry::RouteList::const_iterator
 RibEntry::findInheritedRoute(const Route& route) const
 {
   return std::find_if(m_inheritedRoutes.begin(), m_inheritedRoutes.end(),
-                      bind(&compareFaceId, _1, route.faceId));
+                      [id = route.faceId] (const auto& r) { return r.faceId == id; });
 }
 
 bool
@@ -243,7 +249,7 @@
                                 time::milliseconds maxExpiration) const
 {
   const Route* bestAnnRoute = nullptr;
-  auto entryExpiry = time::steady_clock::TimePoint::min();
+  auto entryExpiry = time::steady_clock::time_point::min();
 
   for (const Route& route : *this) {
     if (route.expires) {
@@ -255,7 +261,7 @@
       }
     }
     else {
-      entryExpiry = time::steady_clock::TimePoint::max();
+      entryExpiry = time::steady_clock::time_point::max();
     }
   }
 
