diff --git a/src/route/face-map.cpp b/src/route/face-map.cpp
deleted file mode 100644
index 52026d0..0000000
--- a/src/route/face-map.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR 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.
- *
- * NLSR 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
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- * \author A K M Mahmudul Hoque <ahoque1@memphis.edu>
- *
- **/
-#include "face-map.hpp"
-#include "common.hpp"
-#include "logger.hpp"
-
-#include <iostream>
-#include <utility>
-
-namespace nlsr {
-
-INIT_LOGGER(route.FaceMap);
-
-void
-FaceMap::writeLog()
-{
-  NLSR_LOG_DEBUG("------- Face Map-----------");
-  for (const auto& it : m_table) {
-    NLSR_LOG_DEBUG("Face Map Entry (FaceUri: " << (it.second).getFaceUri()
-               << " Face Id: " << (it.second).getFaceId() << ")");
-  }
-}
-
-} // namespace nlsr
diff --git a/src/route/face-map.hpp b/src/route/face-map.hpp
deleted file mode 100644
index 9505229..0000000
--- a/src/route/face-map.hpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR 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.
- *
- * NLSR 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
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- **/
-
-#ifndef NLSR_FACE_MAP_HPP
-#define NLSR_FACE_MAP_HPP
-
-#include "common.hpp"
-
-#include <map>
-
-namespace nlsr {
-
-class FaceMapEntry
-{
-
-public:
-  FaceMapEntry(const std::string& faceUri, uint32_t faceId)
-    : m_faceUri(faceUri)
-    , m_faceId(faceId)
-  {
-  }
-
-  void
-  setFaceUri(const std::string& faceUri)
-  {
-    m_faceUri = faceUri;
-  }
-
-  const std::string&
-  getFaceUri() const
-  {
-    return m_faceUri;
-  }
-
-  void
-  setFaceId(uint32_t faceId)
-  {
-    m_faceId = faceId;
-  }
-
-  uint32_t
-  getFaceId() const
-  {
-    return m_faceId;
-  }
-
-  bool
-  compare(const FaceMapEntry& fme)
-  {
-    return m_faceUri == fme.getFaceUri();
-  }
-
-private:
-  std::string m_faceUri;
-  uint32_t m_faceId;
-};
-
-class FaceMap
-{
-
-public:
-  FaceMap()
-  {
-  }
-
-  ~FaceMap()
-  {
-  }
-
-  inline void
-  update(const std::string& faceUri, uint32_t faceId)
-  {
-    FaceMapEntry fme(faceUri, faceId);
-    std::map<std::string, FaceMapEntry>::iterator it = m_table.find(faceUri);
-    if (it == m_table.end()) {
-      m_table.emplace(faceUri, fme);
-    }
-    else {
-      (it->second).setFaceId(fme.getFaceId());
-    }
-  }
-
-  inline uint32_t
-  getFaceId(const std::string& faceUri)
-  {
-    FaceMapEntry fme(faceUri, 0);
-    std::map<std::string, FaceMapEntry>::iterator it = m_table.find(faceUri);
-    if (it != m_table.end()) {
-      return (it->second).getFaceId();
-    }
-    return 0;
-  }
-
-  void
-  writeLog();
-
-private:
-  std::map<std::string, FaceMapEntry> m_table;
-};
-
-} // namespace nlsr
-
-#endif // NLSR_FACE_MAP_HPP
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 9ee14c7..cd2b28c 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -202,9 +202,9 @@
                     uint64_t faceCost, const ndn::time::milliseconds& timeout,
                     uint64_t flags, uint8_t times)
 {
-  uint64_t faceId = m_adjacencyList.getFaceId(ndn::FaceUri(faceUri));
+  uint64_t faceId = m_adjacencyList.getFaceId(faceUri);
 
-  if (faceId != 0) {
+  if (faceId > 0) {
     ndn::nfd::ControlParameters faceParameters;
     faceParameters
      .setName(namePrefix)
@@ -216,13 +216,9 @@
 
     NLSR_LOG_DEBUG("Registering prefix: " << faceParameters.getName() << " faceUri: " << faceUri);
     m_controller.start<ndn::nfd::RibRegisterCommand>(faceParameters,
-                                                     std::bind(&Fib::onRegistrationSuccess, this, _1,
-                                                               "Successful in name registration",
-                                                               faceUri),
-                                                     std::bind(&Fib::onRegistrationFailure, this, _1,
-                                                               "Failed in name registration",
-                                                               faceParameters,
-                                                               faceUri, times));
+      std::bind(&Fib::onRegistrationSuccess, this, _1, faceUri),
+      std::bind(&Fib::onRegistrationFailure, this, _1,
+                faceParameters, faceUri, times));
   }
   else {
     NLSR_LOG_WARN("Error: No Face Id for face uri: " << faceUri);
@@ -230,31 +226,28 @@
 }
 
 void
-Fib::onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
-                           const std::string& message, const ndn::FaceUri& faceUri)
+Fib::onRegistrationSuccess(const ndn::nfd::ControlParameters& param,
+                           const ndn::FaceUri& faceUri)
 {
-  NLSR_LOG_DEBUG(message << ": " << commandSuccessResult.getName() <<
-                 " Face Uri: " << faceUri << " faceId: " << commandSuccessResult.getFaceId());
+  NLSR_LOG_DEBUG("Successful in name registration: " << param.getName() <<
+                 " Face Uri: " << faceUri << " faceId: " << param.getFaceId());
 
   auto adjacent = m_adjacencyList.findAdjacent(faceUri);
   if (adjacent != m_adjacencyList.end()) {
-    adjacent->setFaceId(commandSuccessResult.getFaceId());
+    adjacent->setFaceId(param.getFaceId());
   }
-
-  // Update the fast-access FaceMap with the new Face ID, too
-  m_faceMap.update(faceUri.toString(), commandSuccessResult.getFaceId());
-  m_faceMap.writeLog();
+  onPrefixRegistrationSuccess(param.getName());
 }
 
 void
 Fib::onRegistrationFailure(const ndn::nfd::ControlResponse& response,
-                           const std::string& message,
                            const ndn::nfd::ControlParameters& parameters,
                            const ndn::FaceUri& faceUri,
                            uint8_t times)
 {
-  NLSR_LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
-  NLSR_LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
+  NLSR_LOG_DEBUG("Failed in name registration: " << response.getText() <<
+                 " (code: " << response.getCode() << ")");
+  NLSR_LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << +times);
   if (times < 3) {
     NLSR_LOG_DEBUG("Trying to register again...");
     registerPrefix(parameters.getName(), faceUri,
@@ -270,7 +263,12 @@
 void
 Fib::unregisterPrefix(const ndn::Name& namePrefix, const std::string& faceUri)
 {
-  uint32_t faceId = m_faceMap.getFaceId(faceUri);
+  uint64_t faceId = 0;
+  auto adjacent = m_adjacencyList.findAdjacent(ndn::FaceUri(faceUri));
+  if (adjacent != m_adjacencyList.end()) {
+    faceId = adjacent->getFaceId();
+  }
+
   NLSR_LOG_DEBUG("Unregister prefix: " << namePrefix << " Face Uri: " << faceUri);
   if (faceId > 0) {
     ndn::nfd::ControlParameters controlParameters;
@@ -278,31 +276,20 @@
       .setName(namePrefix)
       .setFaceId(faceId)
       .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
+
     m_controller.start<ndn::nfd::RibUnregisterCommand>(controlParameters,
-                                                       std::bind(&Fib::onUnregistrationSuccess, this, _1,
-                                                                 "Successful in unregistering name"),
-                                                       std::bind(&Fib::onUnregistrationFailure,
-                                                                 this, _1,
-                                                                 "Failed in unregistering name"));
+      [] (const ndn::nfd::ControlParameters& commandSuccessResult) {
+        NLSR_LOG_DEBUG("Unregister successful Prefix: " << commandSuccessResult.getName() <<
+                       " Face Id: " << commandSuccessResult.getFaceId());
+      },
+      [] (const ndn::nfd::ControlResponse& response) {
+        NLSR_LOG_DEBUG("Failed in unregistering name" << ": " << response.getText() <<
+                 " (code: " << response.getCode() << ")");
+      });
   }
 }
 
 void
-Fib::onUnregistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
-                             const std::string& message)
-{
-  NLSR_LOG_DEBUG("Unregister successful Prefix: " << commandSuccessResult.getName() <<
-                 " Face Id: " << commandSuccessResult.getFaceId());
-}
-
-void
-Fib::onUnregistrationFailure(const ndn::nfd::ControlResponse& response,
-                             const std::string& message)
-{
-  NLSR_LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
-}
-
-void
 Fib::setStrategy(const ndn::Name& name, const std::string& strategy, uint32_t count)
 {
   ndn::nfd::ControlParameters parameters;
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index f2d952a..25677e3 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -22,7 +22,6 @@
 #ifndef NLSR_ROUTE_FIB_HPP
 #define NLSR_ROUTE_FIB_HPP
 
-#include "face-map.hpp"
 #include "fib-entry.hpp"
 #include "test-access-control.hpp"
 
@@ -164,30 +163,17 @@
   /*! \brief Log registration success, and update the Face ID associated with a URI.
    */
   void
-  onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
-                        const std::string& message, const ndn::FaceUri& faceUri);
+  onRegistrationSuccess(const ndn::nfd::ControlParameters& param,
+                        const ndn::FaceUri& faceUri);
 
   /*! \brief Retry a prefix (next-hop) registration up to three (3) times.
    */
   void
   onRegistrationFailure(const ndn::nfd::ControlResponse& response,
-                        const std::string& message,
                         const ndn::nfd::ControlParameters& parameters,
                         const ndn::FaceUri& faceUri,
                         uint8_t times);
 
-  /*! \brief Log a successful unregistration.
-   */
-  void
-  onUnregistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
-                          const std::string& message);
-
-  /*! \brief Log an unregistration failure. Does not retry.
-   */
-  void
-  onUnregistrationFailure(const ndn::nfd::ControlResponse& response,
-                               const std::string& message);
-
   /*! \brief Log a successful strategy setting.
    */
   void
@@ -240,6 +226,7 @@
 public:
   static const std::string MULTICAST_STRATEGY;
   static const std::string BEST_ROUTE_V2_STRATEGY;
+  ndn::util::Signal<Fib, const ndn::Name&> onPrefixRegistrationSuccess;
 
 private:
   ndn::Scheduler& m_scheduler;
@@ -247,7 +234,6 @@
   ndn::nfd::Controller m_controller;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  FaceMap m_faceMap;
   std::map<ndn::Name, FibEntry> m_table;
 
 private:
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index a079933..eb821e8 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -142,8 +142,13 @@
   for (size_t i = 0; i < m_nRouters; i++) {
     std::string line;
     for (size_t j = 0; j < m_nRouters; j++) {
-      line += boost::lexical_cast<std::string>(adjMatrix[i][j]);
-      line += " ";
+      if (adjMatrix[i][j] == LinkStateRoutingTableCalculator::NO_NEXT_HOP) {
+        line += "0 ";
+      }
+      else {
+        line += boost::lexical_cast<std::string>(adjMatrix[i][j]);
+        line += " ";
+      }
     }
     line = boost::lexical_cast<std::string>(i) + "|" + line;
     NLSR_LOG_DEBUG(line);
diff --git a/src/route/routing-table-calculator.hpp b/src/route/routing-table-calculator.hpp
index 0a40a1c..683eb58 100644
--- a/src/route/routing-table-calculator.hpp
+++ b/src/route/routing-table-calculator.hpp
@@ -200,6 +200,7 @@
   static const int EMPTY_PARENT;
   static const double INF_DISTANCE;
   static const int NO_MAPPING_NUM;
+public:
   static const int NO_NEXT_HOP;
 
 };
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index 6e01c45..fd98c32 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2017,  The University of Memphis,
+ * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -66,9 +66,8 @@
   inline bool
   operator==(RoutingTableEntry& rhs)
   {
-    return ((*this).getDestination() == rhs.getDestination()
-            &&
-           (*this).getNexthopList() == rhs.getNexthopList());
+    return ((*this).getDestination() == rhs.getDestination() &&
+            (*this).getNexthopList() == rhs.getNexthopList());
   }
 
 protected:
diff --git a/src/route/routing-table-pool-entry.cpp b/src/route/routing-table-pool-entry.cpp
index 7e081ae..9102ed0 100644
--- a/src/route/routing-table-pool-entry.cpp
+++ b/src/route/routing-table-pool-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2017,  The University of Memphis,
+ * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -43,8 +43,7 @@
 bool
 operator==(const RoutingTablePoolEntry& lhs, const RoutingTablePoolEntry& rhs)
 {
-  return (lhs.getDestination() == rhs.getDestination()
-          &&
+  return (lhs.getDestination() == rhs.getDestination() &&
           lhs.getNexthopList() == rhs.getNexthopList());
 }
 
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index f0e4aac..60b05f9 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -27,7 +27,6 @@
 #include "name-prefix-table.hpp"
 #include "logger.hpp"
 
-#include <iostream>
 #include <list>
 #include <string>
 
@@ -42,7 +41,6 @@
   , m_fib(fib)
   , m_lsdb(lsdb)
   , m_namePrefixTable(namePrefixTable)
-  , m_NO_NEXT_HOP{-12345}
   , m_routingCalcInterval{confParam.getRoutingCalcInterval()}
   , m_isRoutingTableCalculating(false)
   , m_isRouteCalculationScheduled(false)
diff --git a/src/route/routing-table.hpp b/src/route/routing-table.hpp
index f43ad11..c149eb7 100644
--- a/src/route/routing-table.hpp
+++ b/src/route/routing-table.hpp
@@ -75,12 +75,6 @@
   void
   scheduleRoutingTableCalculation();
 
-  int
-  getNoNextHop()
-  {
-    return m_NO_NEXT_HOP;
-  }
-
   void
   setRoutingCalcInterval(uint32_t interval)
   {
@@ -141,8 +135,6 @@
   Lsdb& m_lsdb;
   NamePrefixTable& m_namePrefixTable;
 
-  const int m_NO_NEXT_HOP;
-
   std::list<RoutingTableEntry> m_dryTable;
 
   ndn::time::seconds m_routingCalcInterval;
