diff --git a/src/mgmt/nfd/rib-entry.cpp b/src/mgmt/nfd/rib-entry.cpp
index d8293d5..ed7fd67 100644
--- a/src/mgmt/nfd/rib-entry.cpp
+++ b/src/mgmt/nfd/rib-entry.cpp
@@ -53,7 +53,48 @@
 
 Route::Route(const Block& block)
 {
-  wireDecode(block);
+  this->wireDecode(block);
+}
+
+Route&
+Route::setFaceId(uint64_t faceId)
+{
+  m_faceId = faceId;
+  m_wire.reset();
+  return *this;
+}
+
+Route&
+Route::setOrigin(uint64_t origin)
+{
+  m_origin = origin;
+  m_wire.reset();
+  return *this;
+}
+
+Route&
+Route::setCost(uint64_t cost)
+{
+  m_cost = cost;
+  m_wire.reset();
+  return *this;
+}
+
+Route&
+Route::setFlags(uint64_t flags)
+{
+  m_flags = flags;
+  m_wire.reset();
+  return *this;
+}
+
+Route&
+Route::setExpirationPeriod(time::milliseconds expirationPeriod)
+{
+  m_expirationPeriod = expirationPeriod;
+  m_hasInfiniteExpirationPeriod = m_expirationPeriod == INFINITE_EXPIRATION_PERIOD;
+  m_wire.reset();
+  return *this;
 }
 
 template<encoding::Tag TAG>
@@ -64,30 +105,16 @@
 
   // Absence of an ExpirationPeriod signifies non-expiration
   if (!m_hasInfiniteExpirationPeriod) {
-    totalLength += prependNonNegativeIntegerBlock(block,
-                                                  ndn::tlv::nfd::ExpirationPeriod,
-                                                  m_expirationPeriod.count());
+    totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::ExpirationPeriod,
+                                                  static_cast<uint64_t>(m_expirationPeriod.count()));
   }
-
-  totalLength += prependNonNegativeIntegerBlock(block,
-                                                ndn::tlv::nfd::Flags,
-                                                m_flags);
-
-  totalLength += prependNonNegativeIntegerBlock(block,
-                                                ndn::tlv::nfd::Cost,
-                                                m_cost);
-
-  totalLength += prependNonNegativeIntegerBlock(block,
-                                                ndn::tlv::nfd::Origin,
-                                                m_origin);
-
-  totalLength += prependNonNegativeIntegerBlock(block,
-                                                ndn::tlv::nfd::FaceId,
-                                                m_faceId);
+  totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::Flags, m_flags);
+  totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::Cost, m_cost);
+  totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::Origin, m_origin);
+  totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::FaceId, m_faceId);
 
   totalLength += block.prependVarNumber(totalLength);
   totalLength += block.prependVarNumber(ndn::tlv::nfd::Route);
-
   return totalLength;
 }
 
@@ -100,9 +127,8 @@
 const Block&
 Route::wireEncode() const
 {
-  if (m_wire.hasWire()) {
+  if (m_wire.hasWire())
     return m_wire;
-  }
 
   EncodingEstimator estimator;
   size_t estimatedSize = wireEncode(estimator);
@@ -111,7 +137,6 @@
   wireEncode(buffer);
 
   m_wire = buffer.block();
-
   return m_wire;
 }
 
@@ -200,21 +225,38 @@
   return os;
 }
 
+////////////////////
 
-//////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////
-
-
-RibEntry::RibEntry()
-{
-}
+RibEntry::RibEntry() = default;
 
 RibEntry::RibEntry(const Block& block)
 {
-  wireDecode(block);
+  this->wireDecode(block);
 }
 
+RibEntry&
+RibEntry::setName(const Name& prefix)
+{
+  m_prefix = prefix;
+  m_wire.reset();
+  return *this;
+}
+
+RibEntry&
+RibEntry::addRoute(const Route& route)
+{
+  m_routes.push_back(route);
+  m_wire.reset();
+  return *this;
+}
+
+RibEntry&
+RibEntry::clearRoutes()
+{
+  m_routes.clear();
+  m_wire.reset();
+  return *this;
+}
 
 template<encoding::Tag TAG>
 size_t
@@ -232,7 +274,6 @@
 
   totalLength += block.prependVarNumber(totalLength);
   totalLength += block.prependVarNumber(tlv::nfd::RibEntry);
-
   return totalLength;
 }
 
@@ -245,9 +286,8 @@
 const Block&
 RibEntry::wireEncode() const
 {
-  if (m_wire.hasWire()) {
+  if (m_wire.hasWire())
     return m_wire;
-  }
 
   EncodingEstimator estimator;
   size_t estimatedSize = wireEncode(estimator);
@@ -256,7 +296,6 @@
   wireEncode(buffer);
 
   m_wire = buffer.block();
-
   return m_wire;
 }
 
diff --git a/src/mgmt/nfd/rib-entry.hpp b/src/mgmt/nfd/rib-entry.hpp
index 6c1c5a2..b0d7289 100644
--- a/src/mgmt/nfd/rib-entry.hpp
+++ b/src/mgmt/nfd/rib-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -22,7 +22,7 @@
 #ifndef NDN_MGMT_NFD_RIB_ENTRY_HPP
 #define NDN_MGMT_NFD_RIB_ENTRY_HPP
 
-#include "rib-flags.hpp" // include this first, to ensure it compiles on its own.
+#include "rib-flags.hpp"
 #include "../../name.hpp"
 #include "../../util/time.hpp"
 
@@ -55,7 +55,8 @@
   {
   public:
     explicit
-    Error(const std::string& what) : tlv::Error(what)
+    Error(const std::string& what)
+      : tlv::Error(what)
     {
     }
   };
@@ -72,12 +73,7 @@
   }
 
   Route&
-  setFaceId(uint64_t faceId)
-  {
-    m_faceId = faceId;
-    m_wire.reset();
-    return *this;
-  }
+  setFaceId(uint64_t faceId);
 
   uint64_t
   getOrigin() const
@@ -89,12 +85,7 @@
    *  @param origin a code defined in ndn::nfd::RouteOrigin
    */
   Route&
-  setOrigin(uint64_t origin)
-  {
-    m_origin = origin;
-    m_wire.reset();
-    return *this;
-  }
+  setOrigin(uint64_t origin);
 
   uint64_t
   getCost() const
@@ -103,12 +94,7 @@
   }
 
   Route&
-  setCost(uint64_t cost)
-  {
-    m_cost = cost;
-    m_wire.reset();
-    return *this;
-  }
+  setCost(uint64_t cost);
 
   uint64_t
   getFlags() const
@@ -120,31 +106,18 @@
    *  @param flags a bitwise OR'ed code from ndn::nfd::RouteFlags
    */
   Route&
-  setFlags(uint64_t flags)
-  {
-    m_flags = flags;
-    m_wire.reset();
-    return *this;
-  }
+  setFlags(uint64_t flags);
 
   static const time::milliseconds INFINITE_EXPIRATION_PERIOD;
 
-  const time::milliseconds&
+  time::milliseconds
   getExpirationPeriod() const
   {
     return m_expirationPeriod;
   }
 
   Route&
-  setExpirationPeriod(const time::milliseconds& expirationPeriod)
-  {
-    m_expirationPeriod = expirationPeriod;
-
-    m_hasInfiniteExpirationPeriod = m_expirationPeriod == INFINITE_EXPIRATION_PERIOD;
-
-    m_wire.reset();
-    return *this;
-  }
+  setExpirationPeriod(time::milliseconds expirationPeriod);
 
   bool
   hasInfiniteExpirationPeriod() const
@@ -195,7 +168,9 @@
   class Error : public tlv::Error
   {
   public:
-    Error(const std::string& what) : tlv::Error(what)
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
     {
     }
   };
@@ -215,12 +190,7 @@
   }
 
   RibEntry&
-  setName(const Name& prefix)
-  {
-    m_prefix = prefix;
-    m_wire.reset();
-    return *this;
-  }
+  setName(const Name& prefix);
 
   const std::list<Route>&
   getRoutes() const
@@ -229,19 +199,10 @@
   }
 
   RibEntry&
-  addRoute(const Route& route)
-  {
-    m_routes.push_back(route);
-    m_wire.reset();
-    return *this;
-  }
+  addRoute(const Route& route);
 
   RibEntry&
-  clearRoutes()
-  {
-    m_routes.clear();
-    return *this;
-  }
+  clearRoutes();
 
   template<encoding::Tag TAG>
   size_t
