diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index c0c6ce8..4408b03 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -318,41 +318,16 @@
 {
   NFD_LOG_DEBUG("Fetching active faces");
 
-  Interest interest(FACES_LIST_DATASET_PREFIX);
-  interest.setChildSelector(1);
-  interest.setMustBeFresh(true);
-
-  shared_ptr<ndn::OBufferStream> buffer = make_shared<ndn::OBufferStream>();
-
-  m_face.expressInterest(interest,
-                         bind(&RibManager::fetchSegments, this, _2, buffer),
-                         bind(&RibManager::onFetchFaceStatusTimeout, this));
+  m_nfdController.fetch<ndn::nfd::FaceDataset>(
+    bind(&RibManager::removeInvalidFaces, this, _1),
+    bind(&RibManager::onFetchActiveFacesFailure, this, _1, _2),
+    ndn::nfd::CommandOptions());
 }
 
 void
-RibManager::fetchSegments(const Data& data, shared_ptr<ndn::OBufferStream> buffer)
+RibManager::onFetchActiveFacesFailure(uint32_t code, const std::string& reason)
 {
-  buffer->write(reinterpret_cast<const char*>(data.getContent().value()),
-                data.getContent().value_size());
-
-  uint64_t currentSegment = data.getName().get(-1).toSegment();
-
-  const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
-
-  if (finalBlockId.empty() || finalBlockId.toSegment() > currentSegment) {
-    m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment+1),
-                           bind(&RibManager::fetchSegments, this, _2, buffer),
-                           bind(&RibManager::onFetchFaceStatusTimeout, this));
-  }
-  else {
-    removeInvalidFaces(buffer);
-  }
-}
-
-void
-RibManager::onFetchFaceStatusTimeout()
-{
-  std::cerr << "Face Status Dataset request timed out" << std::endl;
+  NFD_LOG_DEBUG("Face Status Dataset request failure " << code << " " << reason);
   scheduleActiveFaceFetch(ACTIVE_FACE_FETCH_INTERVAL);
 }
 
@@ -373,34 +348,19 @@
 }
 
 void
-RibManager::removeInvalidFaces(shared_ptr<ndn::OBufferStream> buffer)
+RibManager::removeInvalidFaces(const std::vector<ndn::nfd::FaceStatus>& activeFaces)
 {
   NFD_LOG_DEBUG("Checking for invalid face registrations");
 
-  ndn::ConstBufferPtr buf = buffer->buf();
-
-  Block block;
-  size_t offset = 0;
-  FaceIdSet activeFaces;
-
-  while (offset < buf->size()) {
-    bool isOk = false;
-    std::tie(isOk, block) = Block::fromBuffer(buf, offset);
-    if (!isOk) {
-      std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
-      break;
-    }
-
-    offset += block.size();
-
-    ndn::nfd::FaceStatus status(block);
-    activeFaces.insert(status.getFaceId());
+  FaceIdSet activeFaceIds;
+  for (const ndn::nfd::FaceStatus& item : activeFaces) {
+    activeFaceIds.insert(item.getFaceId());
   }
 
   // Look for face IDs that were registered but not active to find missed
   // face destroyed events
   for (auto&& faceId : m_registeredFaces) {
-    if (activeFaces.find(faceId) == activeFaces.end()) {
+    if (activeFaceIds.count(faceId) == 0) {
       NFD_LOG_DEBUG("Removing invalid face ID: " << faceId);
 
       scheduler::schedule(time::seconds(0),
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 686ecd7..99f5ccd 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -115,10 +115,7 @@
   fetchActiveFaces();
 
   void
-  fetchSegments(const Data& data, shared_ptr<ndn::OBufferStream> buffer);
-
-  void
-  onFetchFaceStatusTimeout();
+  onFetchActiveFacesFailure(uint32_t code, const std::string& reason);
 
   void
   onFaceDestroyedEvent(uint64_t faceId);
@@ -130,10 +127,10 @@
   /**
    * @brief remove invalid faces
    *
-   * @param buffer Face dataset contents
+   * @param status Face dataset
   */
   void
-  removeInvalidFaces(shared_ptr<ndn::OBufferStream> buffer);
+  removeInvalidFaces(const std::vector<ndn::nfd::FaceStatus>& activeFaces);
 
   /**
    * @brief response to face events
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index f3df261..450016d 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -570,15 +570,10 @@
 
   ndn::nfd::FaceStatus status;
   status.setFaceId(1);
+  std::vector<ndn::nfd::FaceStatus> activeFaces;
+  activeFaces.push_back(status);
 
-  auto data = makeData("/localhost/nfd/faces/list");
-  data->setContent(status.wireEncode());
-
-  auto buffer = make_shared<ndn::OBufferStream>();
-  buffer->write(reinterpret_cast<const char*>(data->getContent().value()),
-                data->getContent().value_size());
-
-  m_manager.removeInvalidFaces(buffer);
+  m_manager.removeInvalidFaces(activeFaces);
   advanceClocks(time::milliseconds(100));
   BOOST_REQUIRE_EQUAL(m_rib.size(), 1);
 
