diff --git a/rib/auto-prefix-propagator.hpp b/rib/auto-prefix-propagator.hpp
index 483ab68..f61b129 100644
--- a/rib/auto-prefix-propagator.hpp
+++ b/rib/auto-prefix-propagator.hpp
@@ -28,7 +28,6 @@
 
 #include "rib.hpp"
 #include "core/config-file.hpp"
-#include "rib-status-publisher.hpp"
 #include "propagated-entry.hpp"
 
 #include <ndn-cxx/security/key-chain.hpp>
diff --git a/rib/rib-entry.hpp b/rib/rib-entry.hpp
index 52f070f..c3c5b4c 100644
--- a/rib/rib-entry.hpp
+++ b/rib/rib-entry.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-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -186,7 +186,7 @@
   /** \brief The number of routes on this namespace with the capture flag set.
    *
    *  This count is used to check if the namespace will block inherited routes.
-   *  If the number is greater than zero, a route on the namespace has it's capture
+   *  If the number is greater than zero, a route on the namespace has its capture
    *  flag set which means the namespace should not inherit any routes.
    */
   uint64_t m_nRoutesWithCaptureSet;
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 7f63745..c28ea71 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -29,7 +29,6 @@
 #include "rib.hpp"
 #include "core/config-file.hpp"
 #include "core/manager-base.hpp"
-#include "rib-status-publisher.hpp"
 #include "auto-prefix-propagator.hpp"
 #include "fib-updater.hpp"
 
diff --git a/rib/rib-status-publisher.cpp b/rib/rib-status-publisher.cpp
deleted file mode 100644
index cdf5cff..0000000
--- a/rib/rib-status-publisher.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib-status-publisher.hpp"
-#include "rib/rib.hpp"
-#include "core/logger.hpp"
-
-#include <ndn-cxx/management/nfd-rib-entry.hpp>
-#include <ndn-cxx/face.hpp>
-
-namespace nfd {
-namespace rib {
-
-NFD_LOG_INIT("RibStatusPublisher");
-
-RibStatusPublisher::RibStatusPublisher(const Rib& rib,
-                                       ndn::Face& face,
-                                       const Name& prefix,
-                                       ndn::KeyChain& keyChain)
-  : SegmentPublisher<ndn::Face>(face, prefix, keyChain)
-  , m_rib(rib)
-{
-}
-
-RibStatusPublisher::~RibStatusPublisher()
-{
-}
-
-size_t
-RibStatusPublisher::generate(ndn::EncodingBuffer& outBuffer)
-{
-  size_t totalLength = 0;
-
-  for (Rib::const_iterator ribIt = m_rib.begin(); ribIt != m_rib.end(); ++ribIt)
-    {
-      RibEntry& entry = *ribIt->second;
-
-      const Name& prefix = entry.getName();
-      size_t ribEntryLength = 0;
-
-      ndn::nfd::RibEntry tlvEntry;
-
-      for (const Route& route : entry)
-        {
-          ndn::nfd::Route routeEle;
-          routeEle.setFaceId(route.faceId)
-                  .setOrigin(route.origin)
-                  .setCost(route.cost)
-                  .setFlags(route.flags);
-
-          if (route.expires < time::steady_clock::TimePoint::max()) {
-            routeEle.setExpirationPeriod(time::duration_cast<time::milliseconds>(
-              route.expires - time::steady_clock::now()));
-          }
-
-          tlvEntry.addRoute(routeEle);
-        }
-
-      tlvEntry.setName(prefix);
-      ribEntryLength += tlvEntry.wireEncode(outBuffer);
-
-      NFD_LOG_DEBUG("generate: rib entry length = " << ribEntryLength);
-
-      totalLength += ribEntryLength;
-    }
-  NFD_LOG_DEBUG("generate: Total length = " << totalLength);
-  return totalLength;
-}
-
-
-} // namespace rib
-} // namespace nfd
diff --git a/rib/rib-status-publisher.hpp b/rib/rib-status-publisher.hpp
deleted file mode 100644
index 8673983..0000000
--- a/rib/rib-status-publisher.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_RIB_STATUS_PUBLISHER_HPP
-#define NFD_RIB_RIB_STATUS_PUBLISHER_HPP
-
-#include "core/segment-publisher.hpp"
-#include <ndn-cxx/face.hpp>
-
-namespace nfd {
-namespace rib {
-
-class Rib;
-
-class RibStatusPublisher : public SegmentPublisher<ndn::Face>
-{
-public:
-  RibStatusPublisher(const Rib& rib,
-                     ndn::Face& face,
-                     const Name& prefix,
-                     ndn::KeyChain& keyChain);
-
-  virtual
-  ~RibStatusPublisher();
-
-protected:
-  virtual size_t
-  generate(ndn::EncodingBuffer& outBuffer);
-
-private:
-  const Rib& m_rib;
-};
-
-
-} // namespace rib
-} // namespace nfd
-
-#endif
diff --git a/tests/rib/rib-status-publisher-common.hpp b/tests/rib/rib-status-publisher-common.hpp
deleted file mode 100644
index 3fc7fad..0000000
--- a/tests/rib/rib-status-publisher-common.hpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
-#define RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
-
-#include "rib/rib-status-publisher.hpp"
-#include "rib/rib.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/identity-management-fixture.hpp"
-
-#include <ndn-cxx/management/nfd-control-parameters.hpp>
-#include <ndn-cxx/management/nfd-rib-entry.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/encoding/tlv-nfd.hpp>
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-using namespace nfd::tests;
-
-using ndn::nfd::ControlParameters;
-
-class RibStatusPublisherFixture : public IdentityManagementFixture
-{
-public:
-  static void
-  validateRibEntry(const Block& block, const Name& referenceName, const Route& referenceRoute)
-  {
-    ndn::nfd::RibEntry entry;
-    BOOST_REQUIRE_NO_THROW(entry.wireDecode(block));
-
-    BOOST_CHECK_EQUAL(entry.getName(), referenceName);
-
-    std::list<ndn::nfd::Route> routes = entry.getRoutes();
-
-    std::list<ndn::nfd::Route>::iterator it = routes.begin();
-    BOOST_CHECK_EQUAL(it->getFaceId(), referenceRoute.faceId);
-    BOOST_CHECK_EQUAL(it->getOrigin(), referenceRoute.origin);
-    BOOST_CHECK_EQUAL(it->getCost(), referenceRoute.cost);
-    BOOST_CHECK_EQUAL(it->getFlags(), referenceRoute.flags);
-  }
-
-  static void
-  decodeRibEntryBlock(const Data& data, const Name& referenceName, const Route& referenceRoute)
-  {
-    ndn::EncodingBuffer buffer;
-
-    Block payload = data.getContent();
-
-    buffer.appendByteArray(payload.value(), payload.value_size());
-    buffer.prependVarNumber(buffer.size());
-    buffer.prependVarNumber(tlv::Content);
-
-    ndn::Block parser(buffer.buf(), buffer.size());
-    parser.parse();
-
-    Block::element_const_iterator i = parser.elements_begin();
-
-    if (i->type() != ndn::tlv::nfd::RibEntry) {
-      BOOST_FAIL("expected RibEntry, got type #" << i->type());
-    }
-    else {
-      validateRibEntry(*i, referenceName, referenceRoute);
-    }
-  }
-};
-
-#endif // RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/tests/rib/rib-status-publisher.t.cpp b/tests/rib/rib-status-publisher.t.cpp
deleted file mode 100644
index 9600d10..0000000
--- a/tests/rib/rib-status-publisher.t.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib-status-publisher.hpp"
-#include "rib-status-publisher-common.hpp"
-
-#include "tests/test-common.hpp"
-#include <ndn-cxx/util/dummy-client-face.hpp>
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(TestRibStatusPublisher, RibStatusPublisherFixture)
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
-  Rib rib;
-
-  Route route;
-  Name name("/");
-  route.faceId = 1;
-  route.origin = 128;
-  route.cost = 32;
-  route.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
-  rib.insert(name, route);
-
-  ndn::util::DummyClientFace face(getGlobalIoService(), m_keyChain);
-  RibStatusPublisher publisher(rib, face, "/localhost/nfd/rib/list", m_keyChain);
-
-  publisher.publish();
-  face.processEvents(time::milliseconds(1));
-
-  BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
-  decodeRibEntryBlock(face.sentData[0], name, route);
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
