diff --git a/core/common.hpp b/core/common.hpp
index b0fc450..2678a17 100644
--- a/core/common.hpp
+++ b/core/common.hpp
@@ -91,8 +91,8 @@
 using std::const_pointer_cast;
 
 using std::bind;
-using std::cref;
-using std::ref;
+
+using namespace std::string_literals;
 
 using ndn::optional;
 using ndn::nullopt;
diff --git a/core/manager-base.hpp b/core/manager-base.hpp
index cddb7c1..a19ccb2 100644
--- a/core/manager-base.hpp
+++ b/core/manager-base.hpp
@@ -161,7 +161,7 @@
   m_dispatcher.addControlCommand<ControlParameters>(
     makeRelPrefix(verb),
     makeAuthorization(verb),
-    bind(&ManagerBase::validateParameters, cref(*command), _1),
+    bind(&ManagerBase::validateParameters, std::cref(*command), _1),
     bind(&ManagerBase::handleCommand, command, handler, _1, _2, _3, _4));
 }
 
diff --git a/core/network-predicate.cpp b/core/network-predicate.cpp
index 5755f32..d10a5e3 100644
--- a/core/network-predicate.cpp
+++ b/core/network-predicate.cpp
@@ -193,8 +193,8 @@
 bool
 NetworkInterfacePredicate::operator()(const ndn::net::NetworkInterface& netif) const
 {
-  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesNetifMatchRule, cref(netif), _1)) &&
-         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesNetifMatchRule, cref(netif), _1));
+  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesNetifMatchRule, std::cref(netif), _1)) &&
+         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesNetifMatchRule, std::cref(netif), _1));
 }
 
 static bool
@@ -214,8 +214,8 @@
 bool
 IpAddressPredicate::operator()(const boost::asio::ip::address& address) const
 {
-  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesAddressMatchRule, cref(address), _1)) &&
-         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesAddressMatchRule, cref(address), _1));
+  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesAddressMatchRule, std::cref(address), _1)) &&
+         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesAddressMatchRule, std::cref(address), _1));
 }
 
 } // namespace nfd
diff --git a/core/rtt-estimator.hpp b/core/rtt-estimator.hpp
index 2b93880..e8a5eb9 100644
--- a/core/rtt-estimator.hpp
+++ b/core/rtt-estimator.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -33,7 +33,7 @@
 /**
  * \brief implements the Mean-Deviation RTT estimator
  *
- * reference: ns3::RttMeanDeviation
+ * \sa ns3::RttMeanDeviation
  *
  * This RttEstimator algorithm is designed for TCP, which is a continuous stream.
  * NDN Interest-Data traffic is not always a continuous stream,
@@ -43,18 +43,18 @@
 class RttEstimator
 {
 public:
-  typedef time::microseconds Duration;
-
-  static Duration
-  getInitialRtt(void)
-  {
-    return time::seconds(1);
-  }
+  using Duration = time::microseconds;
 
   RttEstimator(uint16_t maxMultiplier = 16,
-               Duration minRto = time::milliseconds(1),
+               Duration minRto = 1_ms,
                double gain = 0.1);
 
+  static Duration
+  getInitialRtt()
+  {
+    return 1_s;
+  }
+
   void
   addMeasurement(Duration measure);
 
diff --git a/daemon/face/channel.hpp b/daemon/face/channel.hpp
index 5b870fe..db97cc8 100644
--- a/daemon/face/channel.hpp
+++ b/daemon/face/channel.hpp
@@ -84,25 +84,14 @@
  *  Parameters are passed as a struct rather than individually, so that a future change in the list
  *  of parameters does not require an update to the method signature in all subclasses.
  */
-class FaceParams
+struct FaceParams
 {
-public:
-  // get rid of this constructor and use aggregate init + NSDMIs when we switch to C++14
-  FaceParams() noexcept
-    : persistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
-    , wantLocalFields(false)
-    , wantLpReliability(false)
-    , wantCongestionMarking(boost::logic::indeterminate)
-  {
-  }
-
-public:
-  ndn::nfd::FacePersistency persistency;
+  ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT;
   optional<time::nanoseconds> baseCongestionMarkingInterval;
   optional<uint64_t> defaultCongestionThreshold;
-  bool wantLocalFields;
-  bool wantLpReliability;
-  boost::logic::tribool wantCongestionMarking;
+  bool wantLocalFields = false;
+  bool wantLpReliability = false;
+  boost::logic::tribool wantCongestionMarking = boost::logic::indeterminate;
 };
 
 /** \brief invokes a callback when the face is closed
diff --git a/daemon/face/datagram-transport.hpp b/daemon/face/datagram-transport.hpp
index 0b375ad..669b46e 100644
--- a/daemon/face/datagram-transport.hpp
+++ b/daemon/face/datagram-transport.hpp
@@ -72,12 +72,10 @@
   doSend(Transport::Packet&& packet) override;
 
   void
-  handleSend(const boost::system::error_code& error,
-             size_t nBytesSent, const Block& payload);
+  handleSend(const boost::system::error_code& error, size_t nBytesSent);
 
   void
-  handleReceive(const boost::system::error_code& error,
-                size_t nBytesReceived);
+  handleReceive(const boost::system::error_code& error, size_t nBytesReceived);
 
   void
   processErrorCode(const boost::system::error_code& error);
@@ -120,9 +118,9 @@
   }
 
   m_socket.async_receive_from(boost::asio::buffer(m_receiveBuffer), m_sender,
-                              bind(&DatagramTransport<T, U>::handleReceive, this,
-                                   boost::asio::placeholders::error,
-                                   boost::asio::placeholders::bytes_transferred));
+                              [this] (auto&&... args) {
+                                this->handleReceive(std::forward<decltype(args)>(args)...);
+                              });
 }
 
 template<class T, class U>
@@ -164,10 +162,10 @@
   NFD_LOG_FACE_TRACE(__func__);
 
   m_socket.async_send(boost::asio::buffer(packet.packet),
-                      bind(&DatagramTransport<T, U>::handleSend, this,
-                           boost::asio::placeholders::error,
-                           boost::asio::placeholders::bytes_transferred,
-                           packet.packet));
+                      // packet.packet is copied into the lambda to retain the underlying Buffer
+                      [this, p = packet.packet] (auto&&... args) {
+                        this->handleSend(std::forward<decltype(args)>(args)...);
+                      });
 }
 
 template<class T, class U>
@@ -202,23 +200,20 @@
 
 template<class T, class U>
 void
-DatagramTransport<T, U>::handleReceive(const boost::system::error_code& error,
-                                       size_t nBytesReceived)
+DatagramTransport<T, U>::handleReceive(const boost::system::error_code& error, size_t nBytesReceived)
 {
   receiveDatagram(m_receiveBuffer.data(), nBytesReceived, error);
 
   if (m_socket.is_open())
     m_socket.async_receive_from(boost::asio::buffer(m_receiveBuffer), m_sender,
-                                bind(&DatagramTransport<T, U>::handleReceive, this,
-                                     boost::asio::placeholders::error,
-                                     boost::asio::placeholders::bytes_transferred));
+                                [this] (auto&&... args) {
+                                  this->handleReceive(std::forward<decltype(args)>(args)...);
+                                });
 }
 
 template<class T, class U>
 void
-DatagramTransport<T, U>::handleSend(const boost::system::error_code& error,
-                                    size_t nBytesSent, const Block& payload)
-// 'payload' is unused; it's needed to retain the underlying Buffer
+DatagramTransport<T, U>::handleSend(const boost::system::error_code& error, size_t nBytesSent)
 {
   if (error)
     return processErrorCode(error);
@@ -266,7 +261,7 @@
 
 template<class T, class U>
 Transport::EndpointId
-DatagramTransport<T, U>::makeEndpointId(const typename protocol::endpoint& ep)
+DatagramTransport<T, U>::makeEndpointId(const typename protocol::endpoint&)
 {
   return 0;
 }
diff --git a/daemon/face/ethernet-channel.cpp b/daemon/face/ethernet-channel.cpp
index 3791d44..69c6f45 100644
--- a/daemon/face/ethernet-channel.cpp
+++ b/daemon/face/ethernet-channel.cpp
@@ -65,7 +65,7 @@
   catch (const boost::system::system_error& e) {
     NFD_LOG_CHAN_DEBUG("Face creation for " << remoteEndpoint << " failed: " << e.what());
     if (onConnectFailed)
-      onConnectFailed(504, std::string("Face creation failed: ") + e.what());
+      onConnectFailed(504, "Face creation failed: "s + e.what());
     return;
   }
 
@@ -102,9 +102,7 @@
                            const FaceCreationFailedCallback& onReceiveFailed)
 {
   m_socket.async_read_some(boost::asio::null_buffers(),
-                           bind(&EthernetChannel::handleRead, this,
-                                boost::asio::placeholders::error,
-                                onFaceCreated, onReceiveFailed));
+                           [=] (const auto& e, auto) { this->handleRead(e, onFaceCreated, onReceiveFailed); });
 }
 
 void
@@ -172,7 +170,7 @@
   catch (const EthernetTransport::Error& e) {
     NFD_LOG_CHAN_DEBUG("Face creation for " << sender << " failed: " << e.what());
     if (onReceiveFailed)
-      onReceiveFailed(504, std::string("Face creation failed: ") + e.what());
+      onReceiveFailed(504, "Face creation failed: "s + e.what());
     return;
   }
 
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index d921855..f9767df 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -46,11 +46,10 @@
 EthernetFactory::EthernetFactory(const CtorParams& params)
   : ProtocolFactory(params)
 {
-  m_netifAddConn = netmon->onInterfaceAdded.connect(
-    [this] (const shared_ptr<const ndn::net::NetworkInterface>& netif) {
-      this->applyUnicastConfigToNetif(netif);
-      this->applyMcastConfigToNetif(*netif);
-    });
+  m_netifAddConn = netmon->onInterfaceAdded.connect([this] (const auto& netif) {
+    this->applyUnicastConfigToNetif(netif);
+    this->applyMcastConfigToNetif(*netif);
+  });
 }
 
 void
diff --git a/daemon/face/ethernet-transport.cpp b/daemon/face/ethernet-transport.cpp
index a7e8907..e2ba043 100644
--- a/daemon/face/ethernet-transport.cpp
+++ b/daemon/face/ethernet-transport.cpp
@@ -122,8 +122,7 @@
 EthernetTransport::asyncRead()
 {
   m_socket.async_read_some(boost::asio::null_buffers(),
-                           bind(&EthernetTransport::handleRead, this,
-                                boost::asio::placeholders::error));
+                           [this] (const auto& e, auto) { this->handleRead(e); });
 }
 
 void
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index 1d2db37..872efef 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -47,7 +47,7 @@
 ProtocolFactoryCtorParams
 FaceSystem::makePFCtorParams()
 {
-  auto addFace = bind(&FaceTable::add, &m_faceTable, _1);
+  auto addFace = [&ft = m_faceTable] (auto face) { ft.add(std::move(face)); };
   return {addFace, m_netmon};
 }
 
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index 5122755..e2f7e0e 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -36,17 +36,6 @@
 
 constexpr uint32_t DEFAULT_CONGESTION_THRESHOLD_DIVISOR = 2;
 
-GenericLinkService::Options::Options()
-  : allowLocalFields(false)
-  , allowFragmentation(false)
-  , allowReassembly(false)
-  , allowCongestionMarking(false)
-  , baseCongestionMarkingInterval(time::milliseconds(100)) // Interval from RFC 8289 (CoDel)
-  , defaultCongestionThreshold(65536) // This default value works well for a queue capacity of 200KiB
-  , allowSelfLearning(false)
-{
-}
-
 GenericLinkService::GenericLinkService(const GenericLinkService::Options& options)
   : m_options(options)
   , m_fragmenter(m_options.fragmenterOptions, this)
@@ -57,8 +46,8 @@
   , m_lastMarkTime(time::steady_clock::TimePoint::min())
   , m_nMarkedSinceInMarkingState(0)
 {
-  m_reassembler.beforeTimeout.connect(bind([this] { ++this->nReassemblyTimeouts; }));
-  m_reliability.onDroppedInterest.connect([this] (const Interest& i) { this->notifyDroppedInterest(i); });
+  m_reassembler.beforeTimeout.connect([this] (auto...) { ++this->nReassemblyTimeouts; });
+  m_reliability.onDroppedInterest.connect([this] (const auto& i) { this->notifyDroppedInterest(i); });
   nReassembling.observe(&m_reassembler);
 }
 
@@ -226,7 +215,7 @@
 void
 GenericLinkService::assignSequences(std::vector<lp::Packet>& pkts)
 {
-  std::for_each(pkts.begin(), pkts.end(), bind(&GenericLinkService::assignSequence, this, _1));
+  std::for_each(pkts.begin(), pkts.end(), [this] (auto& pkt) { this->assignSequence(pkt); });
 }
 
 void
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index d0eb3dd..c8eea37 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -98,16 +98,19 @@
   class Options
   {
   public:
-    Options();
+    constexpr
+    Options() noexcept
+    {
+    }
 
   public:
     /** \brief enables encoding of IncomingFaceId, and decoding of NextHopFaceId and CachePolicy
      */
-    bool allowLocalFields;
+    bool allowLocalFields = false;
 
     /** \brief enables fragmentation
      */
-    bool allowFragmentation;
+    bool allowFragmentation = false;
 
     /** \brief options for fragmentation
      */
@@ -115,7 +118,7 @@
 
     /** \brief enables reassembly
      */
-    bool allowReassembly;
+    bool allowReassembly = false;
 
     /** \brief options for reassembly
      */
@@ -127,19 +130,23 @@
 
     /** \brief enables send queue congestion detection and marking
      */
-    bool allowCongestionMarking;
+    bool allowCongestionMarking = false;
 
     /** \brief starting value for congestion marking interval
+     *
+     *  The default value (100 ms) is taken from RFC 8289 (CoDel).
      */
-    time::nanoseconds baseCongestionMarkingInterval;
+    time::nanoseconds baseCongestionMarkingInterval = 100_ms;
 
     /** \brief default congestion threshold in bytes
+     *
+     *  The default value (64 KiB) works well for a queue capacity of 200 KiB.
      */
-    size_t defaultCongestionThreshold;
+    size_t defaultCongestionThreshold = 65536;
 
     /** \brief enables self-learning forwarding support
      */
-    bool allowSelfLearning;
+    bool allowSelfLearning = false;
   };
 
   /** \brief counters provided by GenericLinkService
@@ -147,7 +154,7 @@
   using Counters = GenericLinkServiceCounters;
 
   explicit
-  GenericLinkService(const Options& options = Options());
+  GenericLinkService(const Options& options = {});
 
   /** \brief get Options used by GenericLinkService
    */
@@ -283,6 +290,7 @@
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /// CongestionMark TLV-TYPE (3 octets) + CongestionMark TLV-LENGTH (1 octet) + sizeof(uint64_t)
   static constexpr size_t CONGESTION_MARK_SIZE = 3 + 1 + sizeof(uint64_t);
+
   /// Time to mark next packet due to send queue congestion
   time::steady_clock::TimePoint m_nextMarkTime;
   /// Time last packet was marked
diff --git a/daemon/face/lp-fragmenter.cpp b/daemon/face/lp-fragmenter.cpp
index 1928bf5..7494ca7 100644
--- a/daemon/face/lp-fragmenter.cpp
+++ b/daemon/face/lp-fragmenter.cpp
@@ -57,11 +57,6 @@
   1 + 1 + 8 + // FragCount TLV
   1 + 9; // Fragment TLV-TYPE and TLV-LENGTH
 
-LpFragmenter::Options::Options()
-  : nMaxFragments(400)
-{
-}
-
 LpFragmenter::LpFragmenter(const LpFragmenter::Options& options, const LinkService* linkService)
   : m_options(options)
   , m_linkService(linkService)
@@ -122,7 +117,7 @@
   // compute FragCount
   if (fragCount > m_options.nMaxFragments) {
     NFD_LOG_FACE_WARN("fragmentation error, FragCount over limit: DROP");
-    return std::make_pair(false, std::vector<lp::Packet>{});
+    return std::make_tuple(false, std::vector<lp::Packet>{});
   }
 
   // populate fragments
@@ -135,7 +130,7 @@
     lp::Packet& frag = frags[fragIndex];
     frag.add<lp::FragIndexField>(fragIndex);
     frag.add<lp::FragCountField>(fragCount);
-    frag.set<lp::FragmentField>(std::make_pair(fragBegin, fragEnd));
+    frag.set<lp::FragmentField>({fragBegin, fragEnd});
     BOOST_ASSERT(frag.wireEncode().size() <= mtu);
 
     ++fragIndex;
@@ -144,7 +139,7 @@
   }
   BOOST_ASSERT(fragIndex == fragCount);
 
-  return std::make_pair(true, frags);
+  return std::make_tuple(true, frags);
 }
 
 std::ostream&
diff --git a/daemon/face/lp-fragmenter.hpp b/daemon/face/lp-fragmenter.hpp
index 40d32cb..51d14d9 100644
--- a/daemon/face/lp-fragmenter.hpp
+++ b/daemon/face/lp-fragmenter.hpp
@@ -44,19 +44,15 @@
 public:
   /** \brief Options that control the behavior of LpFragmenter
    */
-  class Options
+  struct Options
   {
-  public:
-    Options();
-
-  public:
     /** \brief maximum number of fragments in a packet
      */
-    size_t nMaxFragments;
+    size_t nMaxFragments = 400;
   };
 
   explicit
-  LpFragmenter(const Options& options = Options(), const LinkService* linkService = nullptr);
+  LpFragmenter(const Options& options, const LinkService* linkService = nullptr);
 
   /** \brief set options for fragmenter
    */
diff --git a/daemon/face/lp-reassembler.cpp b/daemon/face/lp-reassembler.cpp
index a6d1c60..cd6f873 100644
--- a/daemon/face/lp-reassembler.cpp
+++ b/daemon/face/lp-reassembler.cpp
@@ -33,12 +33,6 @@
 
 NFD_LOG_INIT(LpReassembler);
 
-LpReassembler::Options::Options()
-  : nMaxFragments(400)
-  , reassemblyTimeout(time::milliseconds(500))
-{
-}
-
 LpReassembler::LpReassembler(const LpReassembler::Options& options, const LinkService* linkService)
   : m_options(options)
   , m_linkService(linkService)
@@ -119,8 +113,7 @@
   }
 
   // set drop timer
-  pp.dropTimer = scheduler::schedule(m_options.reassemblyTimeout,
-                                     bind(&LpReassembler::timeoutPartialPacket, this, key));
+  pp.dropTimer = scheduler::schedule(m_options.reassemblyTimeout, [=] { timeoutPartialPacket(key); });
 
   return FALSE_RETURN;
 }
@@ -130,7 +123,7 @@
 {
   PartialPacket& pp = m_partialPackets[key];
 
-  size_t payloadSize = std::accumulate(pp.fragments.begin(), pp.fragments.end(), 0,
+  size_t payloadSize = std::accumulate(pp.fragments.begin(), pp.fragments.end(), 0U,
     [&] (size_t sum, const lp::Packet& pkt) -> size_t {
       ndn::Buffer::const_iterator fragBegin, fragEnd;
       std::tie(fragBegin, fragEnd) = pkt.get<lp::FragmentField>();
@@ -138,7 +131,7 @@
     });
 
   ndn::Buffer fragBuffer(payloadSize);
-  ndn::Buffer::iterator it = fragBuffer.begin();
+  auto it = fragBuffer.begin();
 
   for (const lp::Packet& frag : pp.fragments) {
     ndn::Buffer::const_iterator fragBegin, fragEnd;
diff --git a/daemon/face/lp-reassembler.hpp b/daemon/face/lp-reassembler.hpp
index fd0d874..f416b2c 100644
--- a/daemon/face/lp-reassembler.hpp
+++ b/daemon/face/lp-reassembler.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -38,32 +38,28 @@
 class LinkService;
 
 /** \brief reassembles fragmented network-layer packets
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
+ *  \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
  */
 class LpReassembler : noncopyable
 {
 public:
   /** \brief Options that control the behavior of LpReassembler
    */
-  class Options
+  struct Options
   {
-  public:
-    Options();
-
-  public:
     /** \brief maximum number of fragments in a packet
      *
      *  LpPackets with FragCount over this limit are dropped.
      */
-    size_t nMaxFragments;
+    size_t nMaxFragments = 400;
 
     /** \brief timeout before a partially reassembled packet is dropped
      */
-    time::nanoseconds reassemblyTimeout;
+    time::nanoseconds reassemblyTimeout = 500_ms;
   };
 
   explicit
-  LpReassembler(const Options& options = Options(), const LinkService* linkService = nullptr);
+  LpReassembler(const Options& options, const LinkService* linkService = nullptr);
 
   /** \brief set options for reassembler
    */
diff --git a/daemon/face/lp-reliability.cpp b/daemon/face/lp-reliability.cpp
index 5a4621d..7b248fb 100644
--- a/daemon/face/lp-reliability.cpp
+++ b/daemon/face/lp-reliability.cpp
@@ -39,13 +39,13 @@
 {
   BOOST_ASSERT(m_linkService != nullptr);
 
-  BOOST_ASSERT(m_options.idleAckTimerPeriod > time::nanoseconds::zero());
+  BOOST_ASSERT(m_options.idleAckTimerPeriod > 0_ns);
 }
 
 void
 LpReliability::setOptions(const Options& options)
 {
-  BOOST_ASSERT(options.idleAckTimerPeriod > time::nanoseconds::zero());
+  BOOST_ASSERT(options.idleAckTimerPeriod > 0_ns);
 
   if (m_options.isEnabled && !options.isEnabled) {
     this->stopIdleAckTimer();
@@ -81,8 +81,7 @@
                                                  std::forward_as_tuple(txSeq),
                                                  std::forward_as_tuple(frag));
     unackedFragsIt->second.sendTime = sendTime;
-    unackedFragsIt->second.rtoTimer =
-      scheduler::schedule(m_rto.computeRto(), bind(&LpReliability::onLpPacketLost, this, txSeq));
+    unackedFragsIt->second.rtoTimer = scheduler::schedule(m_rto.computeRto(), [=] { onLpPacketLost(txSeq); });
     unackedFragsIt->second.netPkt = netPkt;
 
     if (m_unackedFrags.size() == 1) {
@@ -305,8 +304,7 @@
     m_linkService->sendLpPacket(lp::Packet(newTxFrag.pkt));
 
     // Start RTO timer for this sequence
-    newTxFrag.rtoTimer = scheduler::schedule(m_rto.computeRto(),
-                                          bind(&LpReliability::onLpPacketLost, this, newTxSeq));
+    newTxFrag.rtoTimer = scheduler::schedule(m_rto.computeRto(), [=] { onLpPacketLost(newTxSeq); });
   }
 
   return removedThisTxSeq;
diff --git a/daemon/face/lp-reliability.hpp b/daemon/face/lp-reliability.hpp
index 896cc0e..9521183 100644
--- a/daemon/face/lp-reliability.hpp
+++ b/daemon/face/lp-reliability.hpp
@@ -57,7 +57,7 @@
 
     /** \brief period between sending pending Acks in an IDLE packet
      */
-    time::nanoseconds idleAckTimerPeriod = time::milliseconds(5);
+    time::nanoseconds idleAckTimerPeriod = 5_ms;
 
     /** \brief a fragment is considered lost if this number of fragments with greater sequence
      *         numbers are acknowledged
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index 3574158..a01063b 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -87,10 +87,10 @@
   NFD_LOG_FACE_TRACE(__func__);
 
   m_sendSocket.async_send_to(boost::asio::buffer(packet.packet), m_multicastGroup,
-                             bind(&MulticastUdpTransport::handleSend, this,
-                                  boost::asio::placeholders::error,
-                                  boost::asio::placeholders::bytes_transferred,
-                                  packet.packet));
+                             // packet.packet is copied into the lambda to retain the underlying Buffer
+                             [this, p = packet.packet] (auto&&... args) {
+                               this->handleSend(std::forward<decltype(args)>(args)...);
+                             });
 }
 
 void
diff --git a/daemon/face/stream-transport.hpp b/daemon/face/stream-transport.hpp
index d70e4f6..9daf29e 100644
--- a/daemon/face/stream-transport.hpp
+++ b/daemon/face/stream-transport.hpp
@@ -200,9 +200,7 @@
 StreamTransport<T>::sendFromQueue()
 {
   boost::asio::async_write(m_socket, boost::asio::buffer(m_sendQueue.front()),
-                           bind(&StreamTransport<T>::handleSend, this,
-                                boost::asio::placeholders::error,
-                                boost::asio::placeholders::bytes_transferred));
+                           [this] (auto&&... args) { this->handleSend(std::forward<decltype(args)>(args)...); });
 }
 
 template<class T>
@@ -232,9 +230,7 @@
 
   m_socket.async_receive(boost::asio::buffer(m_receiveBuffer + m_receiveBufferSize,
                                              ndn::MAX_NDN_PACKET_SIZE - m_receiveBufferSize),
-                         bind(&StreamTransport<T>::handleReceive, this,
-                              boost::asio::placeholders::error,
-                              boost::asio::placeholders::bytes_transferred));
+                         [this] (auto&&... args) { this->handleReceive(std::forward<decltype(args)>(args)...); });
 }
 
 template<class T>
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 1e6b410..639b27d 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -83,15 +83,15 @@
     return;
   }
 
-  auto clientSocket = make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
-  auto timeoutEvent = scheduler::schedule(timeout, bind(&TcpChannel::handleConnectTimeout, this,
-                                                        remoteEndpoint, clientSocket, onConnectFailed));
+  auto clientSocket = make_shared<ip::tcp::socket>(std::ref(getGlobalIoService()));
+  auto timeoutEvent = scheduler::schedule(timeout, [=] {
+    handleConnectTimeout(remoteEndpoint, clientSocket, onConnectFailed);
+  });
 
   NFD_LOG_CHAN_TRACE("Connecting to " << remoteEndpoint);
-  clientSocket->async_connect(remoteEndpoint,
-                              bind(&TcpChannel::handleConnect, this,
-                                   boost::asio::placeholders::error, remoteEndpoint, clientSocket,
-                                   params, timeoutEvent, onFaceCreated, onConnectFailed));
+  clientSocket->async_connect(remoteEndpoint, [=] (const auto& e) {
+    this->handleConnect(e, remoteEndpoint, clientSocket, params, timeoutEvent, onFaceCreated, onConnectFailed);
+  });
 }
 
 void
@@ -151,9 +151,7 @@
 TcpChannel::accept(const FaceCreatedCallback& onFaceCreated,
                    const FaceCreationFailedCallback& onAcceptFailed)
 {
-  m_acceptor.async_accept(m_socket, bind(&TcpChannel::handleAccept, this,
-                                         boost::asio::placeholders::error,
-                                         onFaceCreated, onAcceptFailed));
+  m_acceptor.async_accept(m_socket, [=] (const auto& e) { this->handleAccept(e, onFaceCreated, onAcceptFailed); });
 }
 
 void
diff --git a/daemon/face/tcp-transport.cpp b/daemon/face/tcp-transport.cpp
index ad1be5d..78d7097 100644
--- a/daemon/face/tcp-transport.cpp
+++ b/daemon/face/tcp-transport.cpp
@@ -35,8 +35,8 @@
 
 NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>, TcpTransport);
 
-time::milliseconds TcpTransport::s_initialReconnectWait = time::seconds(1);
-time::milliseconds TcpTransport::s_maxReconnectWait = time::minutes(5);
+time::milliseconds TcpTransport::s_initialReconnectWait = 1_s;
+time::milliseconds TcpTransport::s_maxReconnectWait = 5_min;
 float TcpTransport::s_reconnectWaitMultiplier = 2.0f;
 
 TcpTransport::TcpTransport(protocol::socket&& socket, ndn::nfd::FacePersistency persistency, ndn::nfd::FaceScope faceScope)
@@ -134,10 +134,8 @@
   this->resetReceiveBuffer();
   this->resetSendQueue();
 
-  m_reconnectEvent = scheduler::schedule(m_nextReconnectWait,
-                                         [this] { handleReconnectTimeout(); });
-  m_socket.async_connect(m_remoteEndpoint,
-                         [this] (const boost::system::error_code& error) { handleReconnect(error); });
+  m_reconnectEvent = scheduler::schedule(m_nextReconnectWait, [this] { this->handleReconnectTimeout(); });
+  m_socket.async_connect(m_remoteEndpoint, [this] (const auto& e) { this->handleReconnect(e); });
 }
 
 void
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
index 3d6e6b8..b87e697 100644
--- a/daemon/face/udp-channel.cpp
+++ b/daemon/face/udp-channel.cpp
@@ -60,7 +60,7 @@
   catch (const boost::system::system_error& e) {
     NFD_LOG_CHAN_DEBUG("Face creation for " << remoteEndpoint << " failed: " << e.what());
     if (onConnectFailed)
-      onConnectFailed(504, std::string("Face creation failed: ") + e.what());
+      onConnectFailed(504, "Face creation failed: "s + e.what());
     return;
   }
 
@@ -94,10 +94,9 @@
                            const FaceCreationFailedCallback& onReceiveFailed)
 {
   m_socket.async_receive_from(boost::asio::buffer(m_receiveBuffer), m_remoteEndpoint,
-                              bind(&UdpChannel::handleNewPeer, this,
-                                   boost::asio::placeholders::error,
-                                   boost::asio::placeholders::bytes_transferred,
-                                   onFaceCreated, onReceiveFailed));
+                              [=] (auto&&... args) {
+                                this->handleNewPeer(std::forward<decltype(args)>(args)..., onFaceCreated, onReceiveFailed);
+                              });
 }
 
 void
@@ -127,7 +126,7 @@
   catch (const boost::system::system_error& e) {
     NFD_LOG_CHAN_DEBUG("Face creation for " << m_remoteEndpoint << " failed: " << e.what());
     if (onReceiveFailed)
-      onReceiveFailed(504, std::string("Face creation failed: ") + e.what());
+      onReceiveFailed(504, "Face creation failed: "s + e.what());
     return;
   }
 
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 5d28bed..3660db5 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -50,7 +50,9 @@
 UdpFactory::UdpFactory(const CtorParams& params)
   : ProtocolFactory(params)
 {
-  m_netifAddConn = netmon->onInterfaceAdded.connect(bind(&UdpFactory::applyMcastConfigToNetif, this, _1));
+  m_netifAddConn = netmon->onInterfaceAdded.connect([this] (const auto& netif) {
+    this->applyMcastConfigToNetif(netif);
+  });
 }
 
 void
@@ -414,7 +416,7 @@
     NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": no viable IP address");
     // keep an eye on new addresses
     m_netifConns[netif->getIndex()].addrAddConn =
-      netif->onAddressAdded.connect(bind(&UdpFactory::applyMcastConfigToNetif, this, netif));
+      netif->onAddressAdded.connect([=] (auto...) { this->applyMcastConfigToNetif(netif); });
     return {};
   }
 
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index a127c84..8c58c55 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -101,7 +101,7 @@
   m_acceptor.bind(m_endpoint);
   m_acceptor.listen(backlog);
 
-  if (::chmod(m_endpoint.path().c_str(), 0666) < 0) {
+  if (::chmod(m_endpoint.path().data(), 0666) < 0) {
     BOOST_THROW_EXCEPTION(Error("chmod(" + m_endpoint.path() + ") failed: " + std::strerror(errno)));
   }
 
@@ -113,9 +113,7 @@
 UnixStreamChannel::accept(const FaceCreatedCallback& onFaceCreated,
                           const FaceCreationFailedCallback& onAcceptFailed)
 {
-  m_acceptor.async_accept(m_socket, bind(&UnixStreamChannel::handleAccept, this,
-                                         boost::asio::placeholders::error,
-                                         onFaceCreated, onAcceptFailed));
+  m_acceptor.async_accept(m_socket, [=] (const auto& e) { this->handleAccept(e, onFaceCreated, onAcceptFailed); });
 }
 
 void
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index 2ac9384..ca149b3 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -117,7 +117,7 @@
   NFD_LOG_CHAN_TRACE("Incoming connection from " << m_server.get_con_from_hdl(hdl)->get_remote_endpoint());
 
   auto linkService = make_unique<GenericLinkService>();
-  auto transport = make_unique<WebSocketTransport>(hdl, ref(m_server), m_pingInterval);
+  auto transport = make_unique<WebSocketTransport>(hdl, std::ref(m_server), m_pingInterval);
   auto face = make_shared<Face>(std::move(linkService), std::move(transport));
 
   BOOST_ASSERT(m_channelFaces.count(hdl) == 0);
diff --git a/daemon/face/websocket-transport.cpp b/daemon/face/websocket-transport.cpp
index 97af039..4262287 100644
--- a/daemon/face/websocket-transport.cpp
+++ b/daemon/face/websocket-transport.cpp
@@ -97,7 +97,7 @@
 
   bool isOk = false;
   Block element;
-  std::tie(isOk, element) = Block::fromBuffer(reinterpret_cast<const uint8_t*>(msg.c_str()), msg.size());
+  std::tie(isOk, element) = Block::fromBuffer(reinterpret_cast<const uint8_t*>(msg.data()), msg.size());
   if (!isOk) {
     NFD_LOG_FACE_WARN("Failed to parse message payload");
     return;
@@ -109,7 +109,7 @@
 void
 WebSocketTransport::schedulePing()
 {
-  m_pingEventId = scheduler::schedule(m_pingInterval, bind(&WebSocketTransport::sendPing, this));
+  m_pingEventId = scheduler::schedule(m_pingInterval, [this] { sendPing(); });
 }
 
 void
diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index a766424..8460a00 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -35,8 +35,7 @@
 
 AccessStrategy::AccessStrategy(Forwarder& forwarder, const Name& name)
   : Strategy(forwarder)
-  , m_removeFaceInfoConn(this->beforeRemoveFace.connect(
-                         bind(&AccessStrategy::removeFaceInfo, this, _1)))
+  , m_removeFaceInfoConn(beforeRemoveFace.connect([this] (const Face& face) { removeFaceInfo(face); }))
 {
   ParsedInstanceName parsed = parseInstanceName(name);
   if (!parsed.parameters.empty()) {
@@ -177,14 +176,13 @@
     return;
   }
 
-  pit::InRecordCollection::iterator inRecord = pitEntry->getInRecord(*inFace);
+  auto inRecord = pitEntry->getInRecord(*inFace);
   BOOST_ASSERT(inRecord != pitEntry->in_end());
   // in-record is erased only if Interest is satisfied, and RTO timer should have been cancelled
   // note: if this strategy is extended to send Nacks, that would also erase in-record,
   //       and RTO timer should be cancelled in that case as well
 
   const Interest& interest = inRecord->getInterest();
-
   const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
 
   NFD_LOG_DEBUG(pitEntry->getInterest() << " timeoutFrom " << firstOutFaceId <<
@@ -227,14 +225,14 @@
     return;
   }
 
-  pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(inFace);
+  auto outRecord = pitEntry->getOutRecord(inFace);
   if (outRecord == pitEntry->out_end()) { // no out-record
     NFD_LOG_DEBUG(pitEntry->getInterest() << " dataFrom " << inFace.getId() <<
                   " no-out-record");
     return;
   }
 
-  time::steady_clock::Duration rtt = time::steady_clock::now() - outRecord->getLastRenewed();
+  auto rtt = time::steady_clock::now() - outRecord->getLastRenewed();
   NFD_LOG_DEBUG(pitEntry->getInterest() << " dataFrom " << inFace.getId() <<
                 " rtt=" << time::duration_cast<time::microseconds>(rtt).count());
   this->updateMeasurements(inFace, data, time::duration_cast<RttEstimator::Duration>(rtt));
@@ -260,7 +258,7 @@
 
 AccessStrategy::MtInfo::MtInfo()
   : lastNexthop(face::INVALID_FACEID)
-  , rtt(1, time::milliseconds(1), 0.1)
+  , rtt(1, 1_ms, 0.1)
 {
 }
 
@@ -292,14 +290,13 @@
     BOOST_ASSERT(me != nullptr);
   }
 
-  static const time::nanoseconds ME_LIFETIME = time::seconds(8);
-  this->getMeasurements().extendLifetime(*me, ME_LIFETIME);
+  this->getMeasurements().extendLifetime(*me, 8_s);
 
   return me->insertStrategyInfo<MtInfo>().first;
 }
 
 AccessStrategy::FaceInfo::FaceInfo()
-  : rtt(1, time::milliseconds(1), 0.1)
+  : rtt(1, 1_ms, 0.1)
 {
 }
 
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index 0d772ac..f743e06 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -168,7 +168,7 @@
   FaceInfo* info = nullptr;
 
   if (it == m_fit.end()) {
-    const auto& pair = m_fit.insert(std::make_pair(faceId, FaceInfo()));
+    const auto& pair = m_fit.emplace(faceId, FaceInfo());
     info = &pair.first->second;
 
     extendFaceInfoLifetime(*info, faceId);
@@ -193,9 +193,7 @@
   scheduler::cancel(info.getMeasurementExpirationEventId());
 
   // Refresh measurement
-  scheduler::EventId id = scheduler::schedule(AsfMeasurements::MEASUREMENTS_LIFETIME,
-    bind(&NamespaceInfo::expireFaceInfo, this, faceId));
-
+  auto id = scheduler::schedule(AsfMeasurements::MEASUREMENTS_LIFETIME, [=] { expireFaceInfo(faceId); });
   info.setMeasurementExpirationEventId(id);
 }
 
diff --git a/daemon/fw/asf-measurements.hpp b/daemon/fw/asf-measurements.hpp
index ee5885d..b5b1f8e 100644
--- a/daemon/fw/asf-measurements.hpp
+++ b/daemon/fw/asf-measurements.hpp
@@ -254,8 +254,7 @@
   const FaceInfoTable::iterator
   insert(FaceId faceId)
   {
-    const auto& pair = m_fit.insert(std::make_pair(faceId, FaceInfo()));
-    return pair.first;
+    return m_fit.emplace(faceId, FaceInfo()).first;
   }
 
   bool
@@ -317,7 +316,7 @@
   extendLifetime(measurements::Entry& me);
 
 public:
-  static constexpr time::microseconds MEASUREMENTS_LIFETIME = time::seconds(300);
+  static constexpr time::microseconds MEASUREMENTS_LIFETIME = 300_s;
 
 private:
   MeasurementsAccessor& m_measurements;
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index 24b4577..63f9867 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -70,7 +70,7 @@
                               const Face& faceUsed)
 {
   FaceInfoFacePairSet rankedFaces(
-    [] (FaceInfoFacePair pairLhs, FaceInfoFacePair pairRhs) -> bool {
+    [] (const auto& pairLhs, const auto& pairRhs) -> bool {
       // Sort by RTT
       // If a face has timed-out, rank it behind non-timed-out faces
       FaceInfo& lhs = *pairLhs.first;
@@ -93,14 +93,13 @@
     }
 
     FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest, hopFace.getId());
-
     // If no RTT has been recorded, probe this face
     if (info == nullptr || !info->hasSrttMeasurement()) {
       return &hopFace;
     }
 
     // Add FaceInfo to container sorted by RTT
-    rankedFaces.insert(std::make_pair(info, &hopFace));
+    rankedFaces.insert({info, &hopFace});
   }
 
   if (rankedFaces.empty()) {
@@ -149,7 +148,7 @@
   uint64_t rank = 1;
   double offset = 0.0;
 
-  for (const FaceInfoFacePair pair : rankedFaces) {
+  for (const auto& pair : rankedFaces) {
     double probability = getProbingProbability(rank++, rankSum, rankedFaces.size());
 
     // Is the random number within the bounds of this face's probability + the previous faces'
diff --git a/daemon/fw/asf-probing-module.hpp b/daemon/fw/asf-probing-module.hpp
index 785abd8..02ef155 100644
--- a/daemon/fw/asf-probing-module.hpp
+++ b/daemon/fw/asf-probing-module.hpp
@@ -80,8 +80,8 @@
   getRandomNumber(double start, double end);
 
 public:
-  static constexpr time::milliseconds DEFAULT_PROBING_INTERVAL = time::milliseconds(60000);
-  static constexpr time::milliseconds MIN_PROBING_INTERVAL = time::milliseconds(1000);
+  static constexpr time::milliseconds DEFAULT_PROBING_INTERVAL = 1_min;
+  static constexpr time::milliseconds MIN_PROBING_INTERVAL = 1_s;
 
 private:
   time::milliseconds m_probingInterval;
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
index 69cbec7..e4462e4 100644
--- a/daemon/fw/best-route-strategy.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -44,10 +44,8 @@
   }
 
   const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
-  const fib::NextHopList& nexthops = fibEntry.getNextHops();
-
-  for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
-    Face& outFace = it->getFace();
+  for (const auto& nexthop : fibEntry.getNextHops()) {
+    Face& outFace = nexthop.getFace();
     if (!wouldViolateScope(inFace, interest, outFace) &&
         canForwardToLegacy(*pitEntry, outFace)) {
       this->sendInterest(pitEntry, outFace, interest);
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index 2956ed7..0ab6b25 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -69,7 +69,7 @@
  *  \param wantUnused if true, NextHop must not have unexpired out-record
  *  \param now time::steady_clock::now(), ignored if !wantUnused
  */
-static inline bool
+static bool
 isNextHopEligible(const Face& inFace, const Interest& interest,
                   const fib::NextHop& nexthop,
                   const shared_ptr<pit::Entry>& pitEntry,
@@ -88,7 +88,7 @@
 
   if (wantUnused) {
     // nexthop must not have unexpired out-record
-    pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(outFace);
+    auto outRecord = pitEntry->getOutRecord(outFace);
     if (outRecord != pitEntry->out_end() && outRecord->getExpiry() > now) {
       return false;
     }
@@ -100,23 +100,26 @@
 /** \brief pick an eligible NextHop with earliest out-record
  *  \note It is assumed that every nexthop has an out-record.
  */
-static inline fib::NextHopList::const_iterator
+static fib::NextHopList::const_iterator
 findEligibleNextHopWithEarliestOutRecord(const Face& inFace, const Interest& interest,
                                          const fib::NextHopList& nexthops,
                                          const shared_ptr<pit::Entry>& pitEntry)
 {
-  fib::NextHopList::const_iterator found = nexthops.end();
-  time::steady_clock::TimePoint earliestRenewed = time::steady_clock::TimePoint::max();
-  for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
+  auto found = nexthops.end();
+  auto earliestRenewed = time::steady_clock::TimePoint::max();
+
+  for (auto it = nexthops.begin(); it != nexthops.end(); ++it) {
     if (!isNextHopEligible(inFace, interest, *it, pitEntry))
       continue;
-    pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(it->getFace());
+
+    auto outRecord = pitEntry->getOutRecord(it->getFace());
     BOOST_ASSERT(outRecord != pitEntry->out_end());
     if (outRecord->getLastRenewed() < earliestRenewed) {
       found = it;
       earliestRenewed = outRecord->getLastRenewed();
     }
   }
+
   return found;
 }
 
@@ -133,13 +136,13 @@
 
   const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
   const fib::NextHopList& nexthops = fibEntry.getNextHops();
-  fib::NextHopList::const_iterator it = nexthops.end();
+  auto it = nexthops.end();
 
   if (suppression == RetxSuppressionResult::NEW) {
     // forward to nexthop with lowest cost except downstream
-    it = std::find_if(nexthops.begin(), nexthops.end(),
-      bind(&isNextHopEligible, cref(inFace), interest, _1, pitEntry,
-           false, time::steady_clock::TimePoint::min()));
+    it = std::find_if(nexthops.begin(), nexthops.end(), [&] (const auto& nexthop) {
+      return isNextHopEligible(inFace, interest, nexthop, pitEntry);
+    });
 
     if (it == nexthops.end()) {
       NFD_LOG_DEBUG(interest << " from=" << inFace.getId() << " noNextHop");
@@ -160,9 +163,10 @@
   }
 
   // find an unused upstream with lowest cost except downstream
-  it = std::find_if(nexthops.begin(), nexthops.end(),
-                    bind(&isNextHopEligible, cref(inFace), interest, _1, pitEntry,
-                         true, time::steady_clock::now()));
+  it = std::find_if(nexthops.begin(), nexthops.end(), [&] (const auto& nexthop) {
+    return isNextHopEligible(inFace, interest, nexthop, pitEntry, true, time::steady_clock::now());
+  });
+
   if (it != nexthops.end()) {
     Face& outFace = it->getFace();
     this->sendInterest(pitEntry, outFace, interest);
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index 3e19dd1..7e1880f 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -86,7 +86,7 @@
                " remote=" << face->getRemoteUri() <<
                " local=" << face->getLocalUri());
 
-  connectFaceClosedSignal(*face, bind(&FaceTable::remove, this, faceId));
+  connectFaceClosedSignal(*face, [=] { remove(faceId); });
 
   this->afterAdd(*face);
 }
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index accfb38..7e28db2 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -132,8 +132,8 @@
   // is pending?
   if (!pitEntry->hasInRecords()) {
     m_cs.find(interest,
-              bind(&Forwarder::onContentStoreHit, this, ref(inFace), pitEntry, _1, _2),
-              bind(&Forwarder::onContentStoreMiss, this, ref(inFace), pitEntry, _1));
+              bind(&Forwarder::onContentStoreHit, this, std::ref(inFace), pitEntry, _1, _2),
+              bind(&Forwarder::onContentStoreMiss, this, std::ref(inFace), pitEntry, _1));
   }
   else {
     this->onContentStoreMiss(inFace, pitEntry, interest);
@@ -511,15 +511,7 @@
 
   scheduler::cancel(pitEntry->expiryTimer);
 
-  pitEntry->expiryTimer = scheduler::schedule(duration,
-    bind(&Forwarder::onInterestFinalize, this, pitEntry));
-}
-
-static inline void
-insertNonceToDnl(DeadNonceList& dnl, const pit::Entry& pitEntry,
-                 const pit::OutRecord& outRecord)
-{
-  dnl.add(pitEntry.getName(), outRecord.getLastNonce());
+  pitEntry->expiryTimer = scheduler::schedule(duration, [=] { onInterestFinalize(pitEntry); });
 }
 
 void
@@ -540,13 +532,14 @@
   // Dead Nonce List insert
   if (upstream == nullptr) {
     // insert all outgoing Nonces
-    const pit::OutRecordCollection& outRecords = pitEntry.getOutRecords();
-    std::for_each(outRecords.begin(), outRecords.end(),
-                  bind(&insertNonceToDnl, ref(m_deadNonceList), cref(pitEntry), _1));
+    const auto& outRecords = pitEntry.getOutRecords();
+    std::for_each(outRecords.begin(), outRecords.end(), [&] (const auto& outRecord) {
+      m_deadNonceList.add(pitEntry.getName(), outRecord.getLastNonce());
+    });
   }
   else {
     // insert outgoing Nonce of a specific face
-    pit::OutRecordCollection::iterator outRecord = pitEntry.getOutRecord(*upstream);
+    auto outRecord = pitEntry.getOutRecord(*upstream);
     if (outRecord != pitEntry.getOutRecords().end()) {
       m_deadNonceList.add(pitEntry.getName(), outRecord->getLastNonce());
     }
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index bdb322a..0f7f4e1 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,9 +32,9 @@
 
 NFD_REGISTER_STRATEGY(NccStrategy);
 
-const time::microseconds NccStrategy::DEFER_FIRST_WITHOUT_BEST_FACE = time::microseconds(4000);
-const time::microseconds NccStrategy::DEFER_RANGE_WITHOUT_BEST_FACE = time::microseconds(75000);
-const time::nanoseconds NccStrategy::MEASUREMENTS_LIFETIME = time::seconds(16);
+const time::microseconds NccStrategy::DEFER_FIRST_WITHOUT_BEST_FACE = 4_ms;
+const time::microseconds NccStrategy::DEFER_RANGE_WITHOUT_BEST_FACE = 75_ms;
+const time::nanoseconds NccStrategy::MEASUREMENTS_LIFETIME = 16_s;
 
 NccStrategy::NccStrategy(Forwarder& forwarder, const Name& name)
   : Strategy(forwarder)
@@ -118,7 +118,7 @@
   }
 
   if (nUpstreams > 0) {
-    pitEntryInfo->maxInterval = std::max(time::microseconds(1),
+    pitEntryInfo->maxInterval = std::max(1_us,
       time::microseconds((2 * deferRange.count() + nUpstreams - 1) / nUpstreams));
   }
   else {
@@ -142,7 +142,7 @@
   if (pitEntry == nullptr) {
     return;
   }
-  pit::InRecordCollection::const_iterator inRecord = pitEntry->getInRecord(*inFace);
+  auto inRecord = pitEntry->getInRecord(*inFace);
   if (inRecord == pitEntry->in_end()) {
     return;
   }
@@ -163,10 +163,9 @@
     this->sendInterest(pitEntry, *previousFace, interest);
   }
 
-  const fib::NextHopList& nexthops = fibEntry.getNextHops();
   bool isForwarded = false;
-  for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
-    Face& face = it->getFace();
+  for (const auto& nexthop : fibEntry.getNextHops()) {
+    Face& face = nexthop.getFace();
     if (!wouldViolateScope(*inFace, interest, face) &&
         canForwardToLegacy(*pitEntry, face)) {
       isForwarded = true;
@@ -271,9 +270,9 @@
   return *info;
 }
 
-const time::microseconds NccStrategy::MeasurementsEntryInfo::INITIAL_PREDICTION = time::microseconds(8192);
-const time::microseconds NccStrategy::MeasurementsEntryInfo::MIN_PREDICTION = time::microseconds(127);
-const time::microseconds NccStrategy::MeasurementsEntryInfo::MAX_PREDICTION = time::milliseconds(160);
+const time::microseconds NccStrategy::MeasurementsEntryInfo::INITIAL_PREDICTION = 8192_us;
+const time::microseconds NccStrategy::MeasurementsEntryInfo::MIN_PREDICTION = 127_us;
+const time::microseconds NccStrategy::MeasurementsEntryInfo::MAX_PREDICTION = 160_ms;
 
 NccStrategy::MeasurementsEntryInfo::MeasurementsEntryInfo()
   : prediction(INITIAL_PREDICTION)
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index f2ff1b2..b110588 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,11 +28,9 @@
 namespace nfd {
 namespace fw {
 
-const RetxSuppressionExponential::Duration RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL =
-    time::milliseconds(1);
-const float RetxSuppressionExponential::DEFAULT_MULTIPLIER = 2.0;
-const RetxSuppressionExponential::Duration RetxSuppressionExponential::DEFAULT_MAX_INTERVAL =
-    time::milliseconds(250);
+const RetxSuppressionExponential::Duration RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL = 1_ms;
+const RetxSuppressionExponential::Duration RetxSuppressionExponential::DEFAULT_MAX_INTERVAL = 250_ms;
+const float RetxSuppressionExponential::DEFAULT_MULTIPLIER = 2.0f;
 
 class RetxSuppressionExponential::PitInfo : public StrategyInfo
 {
@@ -63,8 +61,8 @@
   , m_multiplier(multiplier)
   , m_maxInterval(maxInterval)
 {
-  BOOST_ASSERT(initialInterval > time::milliseconds::zero());
-  BOOST_ASSERT(multiplier >= 1.0);
+  BOOST_ASSERT(initialInterval > 0_us);
+  BOOST_ASSERT(multiplier >= 1.0f);
   BOOST_ASSERT(maxInterval >= initialInterval);
 }
 
@@ -76,9 +74,9 @@
     return RetxSuppressionResult::NEW;
   }
 
-  time::steady_clock::TimePoint lastOutgoing = getLastOutgoing(pitEntry);
-  time::steady_clock::TimePoint now = time::steady_clock::now();
-  time::steady_clock::Duration sinceLastOutgoing = now - lastOutgoing;
+  auto lastOutgoing = getLastOutgoing(pitEntry);
+  auto now = time::steady_clock::now();
+  auto sinceLastOutgoing = now - lastOutgoing;
 
   PitInfo* pi = pitEntry.insertStrategyInfo<PitInfo>(m_initialInterval).first;
   bool shouldSuppress = sinceLastOutgoing < pi->suppressionInterval;
@@ -102,9 +100,9 @@
     return RetxSuppressionResult::NEW;
   }
 
-  time::steady_clock::TimePoint lastOutgoing = outRecord->getLastRenewed();
-  time::steady_clock::TimePoint now = time::steady_clock::now();
-  time::steady_clock::Duration sinceLastOutgoing = now - lastOutgoing;
+  auto lastOutgoing = outRecord->getLastRenewed();
+  auto now = time::steady_clock::now();
+  auto sinceLastOutgoing = now - lastOutgoing;
 
   // insertStrategyInfo does not insert m_initialInterval again if it already exists
   PitInfo* pi = outRecord->insertStrategyInfo<PitInfo>(m_initialInterval).first;
diff --git a/daemon/fw/retx-suppression-fixed.cpp b/daemon/fw/retx-suppression-fixed.cpp
index 6245ae3..dddd742 100644
--- a/daemon/fw/retx-suppression-fixed.cpp
+++ b/daemon/fw/retx-suppression-fixed.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,12 +28,12 @@
 namespace nfd {
 namespace fw {
 
-const time::milliseconds RetxSuppressionFixed::DEFAULT_MIN_RETX_INTERVAL(100);
+const time::milliseconds RetxSuppressionFixed::DEFAULT_MIN_RETX_INTERVAL = 100_ms;
 
 RetxSuppressionFixed::RetxSuppressionFixed(const time::milliseconds& minRetxInterval)
   : m_minRetxInterval(minRetxInterval)
 {
-  BOOST_ASSERT(minRetxInterval > time::milliseconds::zero());
+  BOOST_ASSERT(minRetxInterval > 0_ms);
 }
 
 RetxSuppressionResult
diff --git a/daemon/nfd.cpp b/daemon/nfd.cpp
index f96720f..28f6989 100644
--- a/daemon/nfd.cpp
+++ b/daemon/nfd.cpp
@@ -89,7 +89,7 @@
   m_netmon->onNetworkStateChanged.connect([this] {
       // delay stages, so if multiple events are triggered in short sequence,
       // only one auto-detection procedure is triggered
-      m_reloadConfigEvent = scheduler::schedule(time::seconds(5),
+      m_reloadConfigEvent = scheduler::schedule(5_s,
         [this] {
           NFD_LOG_INFO("Network change detected, reloading face section of the config file...");
           this->reloadConfigFileFaceSection();
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp
index 934d759..7984739 100644
--- a/daemon/table/cs-policy-priority-fifo.cpp
+++ b/daemon/table/cs-policy-priority-fifo.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -118,7 +118,7 @@
   else {
     entryInfo->queueType = QUEUE_FIFO;
     entryInfo->moveStaleEventId = scheduler::schedule(i->getData().getFreshnessPeriod(),
-                                                      bind(&PriorityFifoPolicy::moveToStaleQueue, this, i));
+                                                      [=] { moveToStaleQueue(i); });
   }
 
   Queue& queue = m_queues[entryInfo->queueType];
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index 00dc9ee..1663d8f 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -155,7 +155,7 @@
 iterator
 Cs::findLeftmost(const Interest& interest, iterator first, iterator last) const
 {
-  return std::find_if(first, last, bind(&cs::EntryImpl::canSatisfy, _1, interest));
+  return std::find_if(first, last, [&interest] (const auto& entry) { return entry.canSatisfy(interest); });
 }
 
 iterator
@@ -193,7 +193,7 @@
 iterator
 Cs::findRightmostAmongExact(const Interest& interest, iterator first, iterator last) const
 {
-  return find_last_if(first, last, bind(&EntryImpl::canSatisfy, _1, interest));
+  return find_last_if(first, last, [&interest] (const auto& entry) { return entry.canSatisfy(interest); });
 }
 
 void
diff --git a/daemon/table/dead-nonce-list.cpp b/daemon/table/dead-nonce-list.cpp
index d732a90..144e68e 100644
--- a/daemon/table/dead-nonce-list.cpp
+++ b/daemon/table/dead-nonce-list.cpp
@@ -31,8 +31,8 @@
 
 NFD_LOG_INIT(DeadNonceList);
 
-const time::nanoseconds DeadNonceList::DEFAULT_LIFETIME = time::seconds(6);
-const time::nanoseconds DeadNonceList::MIN_LIFETIME = time::milliseconds(1);
+const time::nanoseconds DeadNonceList::DEFAULT_LIFETIME = 6_s;
+const time::nanoseconds DeadNonceList::MIN_LIFETIME = 1_ms;
 const size_t DeadNonceList::INITIAL_CAPACITY = (1 << 7);
 const size_t DeadNonceList::MIN_CAPACITY = (1 << 3);
 const size_t DeadNonceList::MAX_CAPACITY = (1 << 24);
@@ -58,9 +58,8 @@
     m_queue.push_back(MARK);
   }
 
-  m_markEvent = scheduler::schedule(m_markInterval, bind(&DeadNonceList::mark, this));
-  m_adjustCapacityEvent = scheduler::schedule(m_adjustCapacityInterval,
-                                              bind(&DeadNonceList::adjustCapacity, this));
+  m_markEvent = scheduler::schedule(m_markInterval, [this] { mark(); });
+  m_adjustCapacityEvent = scheduler::schedule(m_adjustCapacityInterval, [this] { adjustCapacity(); });
 }
 
 DeadNonceList::~DeadNonceList()
@@ -125,15 +124,13 @@
 
   NFD_LOG_TRACE("mark nMarks=" << nMarks);
 
-  scheduler::schedule(m_markInterval, bind(&DeadNonceList::mark, this));
+  m_markEvent = scheduler::schedule(m_markInterval, [this] { mark(); });
 }
 
 void
 DeadNonceList::adjustCapacity()
 {
-  std::pair<std::multiset<size_t>::iterator, std::multiset<size_t>::iterator> equalRange =
-    m_actualMarkCounts.equal_range(EXPECTED_MARK_COUNT);
-
+  auto equalRange = m_actualMarkCounts.equal_range(EXPECTED_MARK_COUNT);
   if (equalRange.second == m_actualMarkCounts.begin()) {
     // all counts are above expected count, adjust down
     m_capacity = std::max(MIN_CAPACITY,
@@ -148,11 +145,9 @@
   }
 
   m_actualMarkCounts.clear();
-
   this->evictEntries();
 
-  m_adjustCapacityEvent = scheduler::schedule(m_adjustCapacityInterval,
-                                              bind(&DeadNonceList::adjustCapacity, this));
+  m_adjustCapacityEvent = scheduler::schedule(m_adjustCapacityInterval, [this] { adjustCapacity(); });
 }
 
 void
diff --git a/daemon/table/fib.cpp b/daemon/table/fib.cpp
index 0a9522a..7b6d21a 100644
--- a/daemon/table/fib.cpp
+++ b/daemon/table/fib.cpp
@@ -93,12 +93,12 @@
   name_tree::Entry& nte = m_nameTree.lookup(prefix);
   Entry* entry = nte.getFibEntry();
   if (entry != nullptr) {
-    return std::make_pair(entry, false);
+    return {entry, false};
   }
 
   nte.setFibEntry(make_unique<Entry>(prefix));
   ++m_nItems;
-  return std::make_pair(nte.getFibEntry(), true);
+  return {nte.getFibEntry(), true};
 }
 
 void
diff --git a/daemon/table/measurements.cpp b/daemon/table/measurements.cpp
index 4d84746..651a83b 100644
--- a/daemon/table/measurements.cpp
+++ b/daemon/table/measurements.cpp
@@ -50,8 +50,7 @@
   entry = nte.getMeasurementsEntry();
 
   entry->m_expiry = time::steady_clock::now() + getInitialLifetime();
-  entry->m_cleanup = scheduler::schedule(getInitialLifetime(),
-                                         bind(&Measurements::cleanup, this, ref(*entry)));
+  entry->m_cleanup = scheduler::schedule(getInitialLifetime(), [=] { cleanup(*entry); });
 
   return *entry;
 }
@@ -137,7 +136,7 @@
 
   scheduler::cancel(entry.m_cleanup);
   entry.m_expiry = expiry;
-  entry.m_cleanup = scheduler::schedule(lifetime, bind(&Measurements::cleanup, this, ref(entry)));
+  entry.m_cleanup = scheduler::schedule(lifetime, [&] { cleanup(entry); });
 }
 
 void
diff --git a/daemon/table/measurements.hpp b/daemon/table/measurements.hpp
index d110ed6..c72ba28 100644
--- a/daemon/table/measurements.hpp
+++ b/daemon/table/measurements.hpp
@@ -167,7 +167,7 @@
 inline time::nanoseconds
 Measurements::getInitialLifetime()
 {
-  return time::seconds(4);
+  return 4_s;
 }
 
 inline size_t
diff --git a/daemon/table/name-tree-iterator.cpp b/daemon/table/name-tree-iterator.cpp
index 56c0360..f295d9c 100644
--- a/daemon/table/name-tree-iterator.cpp
+++ b/daemon/table/name-tree-iterator.cpp
@@ -46,7 +46,7 @@
 }
 
 Iterator::Iterator(shared_ptr<EnumerationImpl> impl, const Entry* ref)
-  : m_impl(impl)
+  : m_impl(std::move(impl))
   , m_entry(nullptr)
   , m_ref(ref)
   , m_state(0)
diff --git a/daemon/table/name-tree-iterator.hpp b/daemon/table/name-tree-iterator.hpp
index 87a93f7..973c961 100644
--- a/daemon/table/name-tree-iterator.hpp
+++ b/daemon/table/name-tree-iterator.hpp
@@ -69,9 +69,15 @@
 
 /** \brief NameTree iterator
  */
-class Iterator : public std::iterator<std::forward_iterator_tag, const Entry>
+class Iterator
 {
 public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type        = const Entry;
+  using difference_type   = std::ptrdiff_t;
+  using pointer           = value_type*;
+  using reference         = value_type&;
+
   Iterator();
 
   Iterator(shared_ptr<EnumerationImpl> impl, const Entry* ref);
diff --git a/daemon/table/pit-iterator.hpp b/daemon/table/pit-iterator.hpp
index 434dfd0..35e02c5 100644
--- a/daemon/table/pit-iterator.hpp
+++ b/daemon/table/pit-iterator.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -34,9 +34,15 @@
 
 /** \brief PIT iterator
  */
-class Iterator : public std::iterator<std::forward_iterator_tag, const Entry>
+class Iterator
 {
 public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type        = const Entry;
+  using difference_type   = std::ptrdiff_t;
+  using pointer           = value_type*;
+  using reference         = value_type&;
+
   /** \brief constructor
    *  \param ntIt a name tree iterator that visits name tree entries with one or more PIT entries
    *  \param iPitEntry make this iterator to dereference to the i-th PIT entry in name tree entry
diff --git a/rib/fib-updater.cpp b/rib/fib-updater.cpp
index 76a33c7..1d6328c 100644
--- a/rib/fib-updater.cpp
+++ b/rib/fib-updater.cpp
@@ -654,13 +654,11 @@
   }
 
   // Remove inherited routes from current namespace
-  for (Rib::RouteSet::const_iterator removeIt = routesToRemove.begin();
-       removeIt != routesToRemove.end(); )
-  {
+  for (auto removeIt = routesToRemove.begin(); removeIt != routesToRemove.end(); ) {
     // If a route on the namespace has the same face ID and child inheritance set,
     // ignore this route
     if (entry.hasChildInheritOnFaceId(removeIt->faceId)) {
-      routesToRemove.erase(removeIt++);
+      removeIt = routesToRemove.erase(removeIt);
       continue;
     }
 
@@ -674,11 +672,10 @@
   }
 
   // Add inherited routes to current namespace
-  for (Rib::RouteSet::const_iterator addIt = routesToAdd.begin(); addIt != routesToAdd.end(); ) {
-
+  for (auto addIt = routesToAdd.begin(); addIt != routesToAdd.end(); ) {
     // If a route on the namespace has the same face ID and child inherit set, ignore this face
     if (entry.hasChildInheritOnFaceId(addIt->faceId)) {
-      routesToAdd.erase(addIt++);
+      addIt = routesToAdd.erase(addIt);
       continue;
     }
 
diff --git a/rib/readvertise/readvertise.cpp b/rib/readvertise/readvertise.cpp
index 53074f8..7a467ef 100644
--- a/rib/readvertise/readvertise.cpp
+++ b/rib/readvertise/readvertise.cpp
@@ -32,15 +32,15 @@
 
 NFD_LOG_INIT(Readvertise);
 
-const time::milliseconds Readvertise::RETRY_DELAY_MIN = time::seconds(50);
-const time::milliseconds Readvertise::RETRY_DELAY_MAX = time::seconds(3600);
+const time::milliseconds Readvertise::RETRY_DELAY_MIN = 50_s;
+const time::milliseconds Readvertise::RETRY_DELAY_MAX = 3600_s;
 
 static time::milliseconds
 randomizeTimer(time::milliseconds baseTimer)
 {
   std::uniform_int_distribution<uint64_t> dist(-5, 5);
   time::milliseconds newTime = baseTimer + time::milliseconds(dist(getGlobalRng()));
-  return std::max(newTime, time::milliseconds(0));
+  return std::max(newTime, 0_ms);
 }
 
 Readvertise::Readvertise(Rib& rib, unique_ptr<ReadvertisePolicy> policy,
@@ -48,8 +48,8 @@
   : m_policy(std::move(policy))
   , m_destination(std::move(destination))
 {
-  m_addRouteConn = rib.afterAddRoute.connect(bind(&Readvertise::afterAddRoute, this, _1));
-  m_removeRouteConn = rib.beforeRemoveRoute.connect(bind(&Readvertise::beforeRemoveRoute, this, _1));
+  m_addRouteConn = rib.afterAddRoute.connect([this] (const auto& r) { this->afterAddRoute(r); });
+  m_removeRouteConn = rib.beforeRemoveRoute.connect([this] (const auto& r) { this->beforeRemoveRoute(r); });
 
   m_destination->afterAvailabilityChange.connect([this] (bool isAvailable) {
     if (isAvailable) {
@@ -156,17 +156,17 @@
   }
 
   m_destination->advertise(*rrIt,
-    [this, rrIt] {
+    [=] {
       NFD_LOG_DEBUG("advertise " << rrIt->prefix << " success");
       rrIt->retryDelay = RETRY_DELAY_MIN;
       rrIt->retryEvt = scheduler::schedule(randomizeTimer(m_policy->getRefreshInterval()),
-                                           bind(&Readvertise::advertise, this, rrIt));
+                                           [=] { advertise(rrIt); });
     },
-    [this, rrIt] (const std::string& msg) {
+    [=] (const std::string& msg) {
       NFD_LOG_DEBUG("advertise " << rrIt->prefix << " failure " << msg);
       rrIt->retryDelay = std::min(RETRY_DELAY_MAX, rrIt->retryDelay * 2);
       rrIt->retryEvt = scheduler::schedule(randomizeTimer(rrIt->retryDelay),
-                                           bind(&Readvertise::advertise, this, rrIt));
+                                           [=] { advertise(rrIt); });
     });
 }
 
@@ -182,15 +182,14 @@
   }
 
   m_destination->withdraw(*rrIt,
-    [this, rrIt] {
+    [=] {
       NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " success");
       m_rrs.erase(rrIt);
     },
-    [this, rrIt] (const std::string& msg) {
+    [=] (const std::string& msg) {
       NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " failure " << msg);
       rrIt->retryDelay = std::min(RETRY_DELAY_MAX, rrIt->retryDelay * 2);
-      rrIt->retryEvt = scheduler::schedule(randomizeTimer(rrIt->retryDelay),
-                                           bind(&Readvertise::withdraw, this, rrIt));
+      rrIt->retryEvt = scheduler::schedule(randomizeTimer(rrIt->retryDelay), [=] { withdraw(rrIt); });
     });
 }
 
diff --git a/rib/rib-entry.cpp b/rib/rib-entry.cpp
index 7fd0ed7..ff646fa 100644
--- a/rib/rib-entry.cpp
+++ b/rib/rib-entry.cpp
@@ -56,12 +56,10 @@
     }
 
     m_routes.push_back(route);
+    return {std::prev(m_routes.end()), true};
+  }
 
-    return std::make_pair(std::prev(m_routes.end()), true);
-  }
-  else {
-    return std::make_pair(it, false);
-  }
+  return {it, false};
 }
 
 void
@@ -96,16 +94,16 @@
 void
 RibEntry::addChild(shared_ptr<RibEntry> child)
 {
-  BOOST_ASSERT(!static_cast<bool>(child->getParent()));
+  BOOST_ASSERT(!child->getParent());
   child->setParent(this->shared_from_this());
-  m_children.push_back(child);
+  m_children.push_back(std::move(child));
 }
 
 void
 RibEntry::removeChild(shared_ptr<RibEntry> child)
 {
   BOOST_ASSERT(child->getParent().get() == this);
-  child->setParent(shared_ptr<RibEntry>());
+  child->setParent(nullptr);
   m_children.remove(child);
 }
 
@@ -136,9 +134,7 @@
 void
 RibEntry::removeInheritedRoute(const Route& route)
 {
-  RouteList::iterator it = std::find_if(m_inheritedRoutes.begin(), m_inheritedRoutes.end(),
-                                        bind(&compareFaceId, _1, route.faceId));
-  m_inheritedRoutes.erase(it);
+  m_inheritedRoutes.remove_if(bind(&compareFaceId, _1, route.faceId));
 }
 
 RibEntry::RouteList::const_iterator
@@ -151,9 +147,7 @@
 bool
 RibEntry::hasInheritedRoute(const Route& route) const
 {
-  RouteList::const_iterator it = findInheritedRoute(route);
-
-  return (it != m_inheritedRoutes.end());
+  return findInheritedRoute(route) != m_inheritedRoutes.end();
 }
 
 bool
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index ecf20d9..5b0e0c6 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -167,14 +167,14 @@
   }
 
   if (wantReadvertiseToNlsr && m_readvertiseNlsr == nullptr) {
-    NFD_LOG_DEBUG("Enabling readvertise-to-nlsr.");
-    m_readvertiseNlsr.reset(new Readvertise(
+    NFD_LOG_DEBUG("Enabling readvertise-to-nlsr");
+    m_readvertiseNlsr = make_unique<Readvertise>(
       m_rib,
       make_unique<ClientToNlsrReadvertisePolicy>(),
-      make_unique<NfdRibReadvertiseDestination>(m_nfdController, READVERTISE_NLSR_PREFIX, m_rib)));
+      make_unique<NfdRibReadvertiseDestination>(m_nfdController, READVERTISE_NLSR_PREFIX, m_rib));
   }
   else if (!wantReadvertiseToNlsr && m_readvertiseNlsr != nullptr) {
-    NFD_LOG_DEBUG("Disabling readvertise-to-nlsr.");
+    NFD_LOG_DEBUG("Disabling readvertise-to-nlsr");
     m_readvertiseNlsr.reset();
   }
 }
@@ -184,11 +184,11 @@
 {
   // register entry to the FIB
   m_nfdController.start<ndn::nfd::FibAddNextHopCommand>(
-     ControlParameters()
-       .setName(Name(topPrefix).append(MGMT_MODULE_NAME))
-       .setFaceId(0),
-     bind(&RibManager::onCommandPrefixAddNextHopSuccess, this, cref(topPrefix), _1),
-     bind(&RibManager::onCommandPrefixAddNextHopError, this, cref(topPrefix), _1));
+    ControlParameters()
+        .setName(Name(topPrefix).append(MGMT_MODULE_NAME))
+        .setFaceId(0),
+    [=] (const auto& res) { this->onCommandPrefixAddNextHopSuccess(topPrefix, res); },
+    [=] (const auto& res) { this->onCommandPrefixAddNextHopError(topPrefix, res); });
 
   // add top prefix to the dispatcher
   m_addTopPrefix(topPrefix);
@@ -438,8 +438,7 @@
 RibManager::onEnableLocalFieldsError(const ndn::nfd::ControlResponse& response)
 {
   BOOST_THROW_EXCEPTION(Error("Couldn't enable local fields (code: " +
-                              to_string(response.getCode()) + ", info: " + response.getText() +
-                              ")"));
+                              to_string(response.getCode()) + ", info: " + response.getText() + ")"));
 }
 
 } // namespace rib
diff --git a/rib/rib.cpp b/rib/rib.cpp
index d6b125b..6a221ea 100644
--- a/rib/rib.cpp
+++ b/rib/rib.cpp
@@ -68,16 +68,14 @@
 Route*
 Rib::find(const Name& prefix, const Route& route) const
 {
-  RibTable::const_iterator ribIt = m_rib.find(prefix);
+  auto ribIt = m_rib.find(prefix);
 
   // Name prefix exists
   if (ribIt != m_rib.end()) {
     shared_ptr<RibEntry> entry = ribIt->second;
-
-    RibEntry::iterator routeIt = entry->findRoute(route);
-
+    auto routeIt = entry->findRoute(route);
     if (routeIt != entry->end()) {
-      return &((*routeIt));
+      return &*routeIt;
     }
   }
 
@@ -87,7 +85,7 @@
 void
 Rib::insert(const Name& prefix, const Route& route)
 {
-  RibTable::iterator ribIt = m_rib.find(prefix);
+  auto ribIt = m_rib.find(prefix);
 
   // Name prefix exists
   if (ribIt != m_rib.end()) {
@@ -125,13 +123,13 @@
   }
   else {
     // New name prefix
-    shared_ptr<RibEntry> entry = make_shared<RibEntry>();
+    auto entry = make_shared<RibEntry>();
 
     m_rib[prefix] = entry;
     m_nItems++;
 
     entry->setName(prefix);
-    RibEntry::iterator routeIt = entry->insertRoute(route).first;
+    auto routeIt = entry->insertRoute(route).first;
 
     // Find prefix's parent
     shared_ptr<RibEntry> parent = findParent(prefix);
@@ -166,12 +164,12 @@
 void
 Rib::erase(const Name& prefix, const Route& route)
 {
-  RibTable::iterator ribIt = m_rib.find(prefix);
+  auto ribIt = m_rib.find(prefix);
 
   // Name prefix exists
   if (ribIt != m_rib.end()) {
     shared_ptr<RibEntry> entry = ribIt->second;
-    RibEntry::iterator routeIt = entry->findRoute(route);
+    auto routeIt = entry->findRoute(route);
 
     if (routeIt != entry->end()) {
       beforeRemoveRoute(RibRouteRef{entry, routeIt});
@@ -210,23 +208,21 @@
 Rib::findParent(const Name& prefix) const
 {
   for (int i = prefix.size() - 1; i >= 0; i--) {
-    RibTable::const_iterator it = m_rib.find(prefix.getPrefix(i));
-
+    auto it = m_rib.find(prefix.getPrefix(i));
     if (it != m_rib.end()) {
-      return (it->second);
+      return it->second;
     }
   }
 
-  return shared_ptr<RibEntry>();
+  return nullptr;
 }
 
-std::list<shared_ptr<RibEntry> >
+std::list<shared_ptr<RibEntry>>
 Rib::findDescendants(const Name& prefix) const
 {
-  std::list<shared_ptr<RibEntry> > children;
+  std::list<shared_ptr<RibEntry>> children;
 
   RibTable::const_iterator it = m_rib.find(prefix);
-
   if (it != m_rib.end()) {
     ++it;
     for (; it != m_rib.end(); ++it) {
@@ -247,7 +243,7 @@
 {
   std::list<shared_ptr<RibEntry>> children;
 
-  for (std::pair<Name, shared_ptr<RibEntry>> pair : m_rib) {
+  for (const auto& pair : m_rib) {
     if (prefix.isPrefixOf(pair.first)) {
       children.push_back(pair.second);
     }
@@ -288,7 +284,7 @@
     }
   }
 
-  RibTable::iterator nextIt = m_rib.erase(it);
+  auto nextIt = m_rib.erase(it);
 
   // do something after erasing an entry.
   afterEraseEntry(entry->getName());
@@ -462,8 +458,7 @@
 Rib::modifyInheritedRoutes(const RibUpdateList& inheritedRoutes)
 {
   for (const RibUpdate& update : inheritedRoutes) {
-    RibTable::iterator ribIt = m_rib.find(update.getName());
-
+    auto ribIt = m_rib.find(update.getName());
     BOOST_ASSERT(ribIt != m_rib.end());
     shared_ptr<RibEntry> entry(ribIt->second);
 
@@ -485,21 +480,18 @@
 {
   std::list<NameAndRoute> routes;
 
-  FaceLookupTable::iterator lookupIt = m_faceMap.find(faceId);
-
-  // No RIB entries have this face
+  auto lookupIt = m_faceMap.find(faceId);
   if (lookupIt == m_faceMap.end()) {
+    // No RIB entries have this face
     return routes;
   }
 
-  RibEntryList& ribEntries = lookupIt->second;
-
   // For each RIB entry that has faceId
-  for (const shared_ptr<RibEntry>& entry : ribEntries) {
+  for (const auto& entry : lookupIt->second) {
     // Find the routes in the entry
     for (const Route& route : *entry) {
       if (route.faceId == faceId) {
-        routes.push_back(NameAndRoute(entry->getName(), route));
+        routes.emplace_back(entry->getName(), route);
       }
     }
   }
diff --git a/rib/rib.hpp b/rib/rib.hpp
index 14ce12d..c8a0f5d 100644
--- a/rib/rib.hpp
+++ b/rib/rib.hpp
@@ -211,7 +211,7 @@
   modifyInheritedRoutes(const RibUpdateList& inheritedRoutes);
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  typedef std::pair<const Name&,const Route&> NameAndRoute;
+  using NameAndRoute = std::pair<const Name&, const Route&>;
 
   std::list<NameAndRoute>
   findRoutesWithFaceId(uint64_t faceId);
diff --git a/tests/daemon/face/factory-test-common.hpp b/tests/daemon/face/factory-test-common.hpp
index 7b7bdf6..f92d388 100644
--- a/tests/daemon/face/factory-test-common.hpp
+++ b/tests/daemon/face/factory-test-common.hpp
@@ -34,24 +34,6 @@
 namespace face {
 namespace tests {
 
-struct TestFaceParams : public FaceParams
-{
-  TestFaceParams(ndn::nfd::FacePersistency persistency,
-                 optional<time::nanoseconds> baseCongestionMarkingInterval,
-                 optional<uint64_t> defaultCongestionThreshold,
-                 bool wantLocalFields,
-                 bool wantLpReliability,
-                 boost::logic::tribool wantCongestionMarking) noexcept
-  {
-    this->persistency = persistency;
-    this->baseCongestionMarkingInterval = baseCongestionMarkingInterval;
-    this->defaultCongestionThreshold = defaultCongestionThreshold;
-    this->wantLocalFields = wantLocalFields;
-    this->wantLpReliability = wantLpReliability;
-    this->wantCongestionMarking = wantCongestionMarking;
-  }
-};
-
 struct CreateFaceExpectedResult
 {
   enum { FAILURE, SUCCESS } result;
@@ -63,7 +45,7 @@
 createFace(ProtocolFactory& factory,
            const FaceUri& remoteUri,
            const optional<FaceUri>& localUri,
-           const TestFaceParams& params,
+           const FaceParams& params,
            const CreateFaceExpectedResult& expected,
            const std::function<void(const Face&)>& extraChecks = nullptr)
 {
diff --git a/tests/daemon/face/generic-link-service.t.cpp b/tests/daemon/face/generic-link-service.t.cpp
index dfb048c..2192622 100644
--- a/tests/daemon/face/generic-link-service.t.cpp
+++ b/tests/daemon/face/generic-link-service.t.cpp
@@ -57,9 +57,9 @@
     : service(nullptr)
     , transport(nullptr)
   {
-    this->initialize(GenericLinkService::Options());
     // By default, GenericLinkService is created with default options.
     // Test cases may invoke .initialize with alternate options.
+    this->initialize({});
   }
 
   void
@@ -67,14 +67,14 @@
              ssize_t mtu = MTU_UNLIMITED,
              ssize_t sendQueueCapacity = QUEUE_UNSUPPORTED)
   {
-    face.reset(new Face(make_unique<GenericLinkService>(options),
-                        make_unique<DummyTransport>("dummy://",
-                                                    "dummy://",
-                                                    ndn::nfd::FACE_SCOPE_NON_LOCAL,
-                                                    ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
-                                                    ndn::nfd::LINK_TYPE_POINT_TO_POINT,
-                                                    mtu,
-                                                    sendQueueCapacity)));
+    face = make_unique<Face>(make_unique<GenericLinkService>(options),
+                             make_unique<DummyTransport>("dummy://",
+                                                         "dummy://",
+                                                         ndn::nfd::FACE_SCOPE_NON_LOCAL,
+                                                         ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
+                                                         ndn::nfd::LINK_TYPE_POINT_TO_POINT,
+                                                         mtu,
+                                                         sendQueueCapacity));
     service = static_cast<GenericLinkService*>(face->getLinkService());
     transport = static_cast<DummyTransport*>(face->getTransport());
 
@@ -347,7 +347,7 @@
   lp::Packet packet(interest->wireEncode());
 
   // fragment the packet
-  LpFragmenter fragmenter;
+  LpFragmenter fragmenter({});
   size_t mtu = 100;
   bool isOk = false;
   std::vector<lp::Packet> frags;
diff --git a/tests/daemon/face/lp-fragmenter.t.cpp b/tests/daemon/face/lp-fragmenter.t.cpp
index 4bc7022..b3ee8d6 100644
--- a/tests/daemon/face/lp-fragmenter.t.cpp
+++ b/tests/daemon/face/lp-fragmenter.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -33,14 +33,13 @@
 
 using namespace nfd::tests;
 
-BOOST_AUTO_TEST_SUITE(Face)
-
-class LpFragmenterFixture
+class LpFragmenterFixture : public BaseFixture
 {
-public:
-  LpFragmenter fragmenter;
+protected:
+  LpFragmenter fragmenter{{}};
 };
 
+BOOST_AUTO_TEST_SUITE(Face)
 BOOST_FIXTURE_TEST_SUITE(TestLpFragmenter, LpFragmenterFixture)
 
 BOOST_AUTO_TEST_CASE(FragmentSingleFragment)
diff --git a/tests/daemon/face/lp-reassembler.t.cpp b/tests/daemon/face/lp-reassembler.t.cpp
index 9cfa8dd..b1140d8 100644
--- a/tests/daemon/face/lp-reassembler.t.cpp
+++ b/tests/daemon/face/lp-reassembler.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -40,13 +40,13 @@
   {
     reassembler.beforeTimeout.connect(
       [this] (Transport::EndpointId remoteEp, size_t nDroppedFragments) {
-        timeoutHistory.push_back(std::make_tuple(remoteEp, nDroppedFragments));
+        timeoutHistory.push_back({remoteEp, nDroppedFragments});
       });
   }
 
 protected:
-  LpReassembler reassembler;
-  std::vector<std::tuple<Transport::EndpointId, size_t>> timeoutHistory;
+  LpReassembler reassembler{{}};
+  std::vector<std::pair<Transport::EndpointId, size_t>> timeoutHistory;
 
   static const uint8_t data[10];
 };
diff --git a/tests/daemon/face/websocket-transport-fixture.hpp b/tests/daemon/face/websocket-transport-fixture.hpp
index 6fd8e70..374f922 100644
--- a/tests/daemon/face/websocket-transport-fixture.hpp
+++ b/tests/daemon/face/websocket-transport-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -110,7 +110,7 @@
 
     face = make_unique<Face>(
              make_unique<DummyReceiveLinkService>(),
-             make_unique<WebSocketTransport>(serverHdl, ref(server), pingInterval));
+             make_unique<WebSocketTransport>(serverHdl, std::ref(server), pingInterval));
     transport = static_cast<WebSocketTransport*>(face->getTransport());
     serverReceivedPackets = &static_cast<DummyReceiveLinkService*>(face->getLinkService())->receivedPackets;
 
diff --git a/tests/daemon/fw/topology-tester.cpp b/tests/daemon/fw/topology-tester.cpp
index fef3080..41d5d8c 100644
--- a/tests/daemon/fw/topology-tester.cpp
+++ b/tests/daemon/fw/topology-tester.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -24,9 +24,10 @@
  */
 
 #include "topology-tester.hpp"
-#include <ndn-cxx/encoding/encoding-buffer-fwd.hpp>
 #include "face/generic-link-service.hpp"
 
+#include <ndn-cxx/encoding/encoding-buffer-fwd.hpp>
+
 namespace nfd {
 namespace fw {
 namespace tests {
@@ -247,8 +248,8 @@
 TopologyTester::addEchoProducer(ndn::Face& face, const Name& prefix)
 {
   face.setInterestFilter(prefix,
-      [&face] (const ndn::InterestFilter&, const Interest& interest) {
-        shared_ptr<Data> data = makeData(interest.getName());
+      [&face] (const auto&, const Interest& interest) {
+        auto data = makeData(interest.getName());
         face.put(*data);
       });
 }
@@ -266,12 +267,12 @@
     name.appendTimestamp();
   }
 
-  shared_ptr<Interest> interest = makeInterest(name);
+  auto interest = makeInterest(name);
   face.expressInterest(*interest, nullptr, nullptr, nullptr);
 
   if (n > 1) {
-    scheduler::schedule(interval, bind(&TopologyTester::addIntervalConsumer, this,
-                                       ref(face), prefix, interval, n - 1, seq));
+    scheduler::schedule(interval,
+                        [=, &face] { addIntervalConsumer(face, prefix, interval, n - 1, seq); });
   }
 }
 
diff --git a/tests/limited-io.cpp b/tests/limited-io.cpp
index 66a0946..9f8f4dc 100644
--- a/tests/limited-io.cpp
+++ b/tests/limited-io.cpp
@@ -56,8 +56,8 @@
 
   m_reason = NO_WORK;
   m_nOpsRemaining = nOpsLimit;
-  if (timeLimit >= time::nanoseconds::zero()) {
-    m_timeout = scheduler::schedule(timeLimit, bind(&LimitedIo::afterTimeout, this));
+  if (timeLimit >= 0_ns) {
+    m_timeout = scheduler::schedule(timeLimit, [this] { afterTimeout(); });
   }
 
   try {
diff --git a/tools/ndn-autoconfig/ndn-fch-discovery.cpp b/tools/ndn-autoconfig/ndn-fch-discovery.cpp
index ef58ab5..abb934f 100644
--- a/tools/ndn-autoconfig/ndn-fch-discovery.cpp
+++ b/tools/ndn-autoconfig/ndn-fch-discovery.cpp
@@ -27,8 +27,8 @@
 
 #include <boost/algorithm/string.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/regex.hpp>
 
+#include <regex>
 #include <sstream>
 
 namespace ndn {
@@ -47,31 +47,31 @@
   Url(const std::string& url)
     : m_isValid(false)
   {
-    static const boost::regex protocolExp("(\\w+\\d?(\\+\\w+)?)://([^/]*)(\\/[^?]*)?");
-    boost::smatch protocolMatch;
-    if (!boost::regex_match(url, protocolMatch, protocolExp)) {
+    static const std::regex protocolExp("(\\w+\\d?(\\+\\w+)?)://([^/]*)(\\/[^?]*)?");
+    std::smatch protocolMatch;
+    if (!std::regex_match(url, protocolMatch, protocolExp)) {
       return;
     }
     m_scheme = protocolMatch[1];
-    const std::string& authority = protocolMatch[3];
+    std::string authority = protocolMatch[3];
     m_path = protocolMatch[4];
 
     // pattern for IPv6 address enclosed in [ ], with optional port number
-    static const boost::regex v6Exp("^\\[([a-fA-F0-9:]+)\\](?:\\:(\\d+))?$");
+    static const std::regex v6Exp("^\\[([a-fA-F0-9:]+)\\](?:\\:(\\d+))?$");
     // pattern for IPv4-mapped IPv6 address, with optional port number
-    static const boost::regex v4MappedV6Exp("^\\[::ffff:(\\d+(?:\\.\\d+){3})\\](?:\\:(\\d+))?$");
+    static const std::regex v4MappedV6Exp("^\\[::ffff:(\\d+(?:\\.\\d+){3})\\](?:\\:(\\d+))?$");
     // pattern for IPv4/hostname/fd/ifname, with optional port number
-    static const boost::regex v4HostExp("^([^:]+)(?:\\:(\\d+))?$");
+    static const std::regex v4HostExp("^([^:]+)(?:\\:(\\d+))?$");
 
     if (authority.empty()) {
       // UNIX, internal
     }
     else {
-      boost::smatch match;
-      bool isV6 = boost::regex_match(authority, match, v6Exp);
+      std::smatch match;
+      bool isV6 = std::regex_match(authority, match, v6Exp);
       if (isV6 ||
-          boost::regex_match(authority, match, v4MappedV6Exp) ||
-          boost::regex_match(authority, match, v4HostExp)) {
+          std::regex_match(authority, match, v4MappedV6Exp) ||
+          std::regex_match(authority, match, v4HostExp)) {
         m_host = match[1];
         m_port = match[2];
       }
