diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index 56807c7..ccbea1b 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -258,8 +258,18 @@
                                 _1, faceId));
 }
 
+AdjacencyList::iterator
+AdjacencyList::findAdjacent(const ndn::util::FaceUri& faceUri)
+{
+  return std::find_if(m_adjList.begin(),
+                      m_adjList.end(),
+                      [&faceUri] (const Adjacent& adj) {
+                        return faceUri == adj.getFaceUri();
+                      });
+}
+
 uint64_t
-AdjacencyList::getFaceId(const std::string& faceUri)
+AdjacencyList::getFaceId(const ndn::util::FaceUri& faceUri)
 {
   std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
                                                   m_adjList.end(),
diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index c9553de..daceae1 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.hpp
@@ -145,8 +145,11 @@
   AdjacencyList::iterator
   findAdjacent(uint64_t faceId);
 
+  AdjacencyList::iterator
+  findAdjacent(const ndn::util::FaceUri& faceUri);
+
   uint64_t
-  getFaceId(const std::string& faceUri);
+  getFaceId(const ndn::util::FaceUri& faceUri);
 
   void
   writeLog();
diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index fb22ed3..55ddff5 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -16,9 +16,6 @@
  *
  * 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 <iostream>
 #include <string>
@@ -33,13 +30,11 @@
 
 INIT_LOGGER("Adjacent");
 
-using namespace std;
-
 const float Adjacent::DEFAULT_LINK_COST = 10.0;
 
 Adjacent::Adjacent()
     : m_name()
-    , m_connectingFaceUri()
+    , m_faceUri()
     , m_linkCost(DEFAULT_LINK_COST)
     , m_status(STATUS_INACTIVE)
     , m_interestTimedOutNo(0)
@@ -49,7 +44,7 @@
 
 Adjacent::Adjacent(const ndn::Name& an)
     : m_name(an)
-    , m_connectingFaceUri()
+    , m_faceUri()
     , m_linkCost(DEFAULT_LINK_COST)
     , m_status(STATUS_INACTIVE)
     , m_interestTimedOutNo(0)
@@ -57,32 +52,31 @@
   {
   }
 
-Adjacent::Adjacent(const ndn::Name& an, const std::string& cfu,  double lc,
+Adjacent::Adjacent(const ndn::Name& an, const ndn::util::FaceUri& faceUri,  double lc,
                    Status s, uint32_t iton, uint64_t faceId)
     : m_name(an)
-    , m_connectingFaceUri(cfu)
+    , m_faceUri(faceUri)
     , m_linkCost(lc)
     , m_status(s)
     , m_interestTimedOutNo(iton)
     , m_faceId(faceId)
   {
-
   }
 
 bool
 Adjacent::operator==(const Adjacent& adjacent) const
 {
   return (m_name == adjacent.getName()) &&
-         (m_connectingFaceUri == adjacent.getConnectingFaceUri()) &&
+         (m_faceUri == adjacent.getFaceUri()) &&
          (std::abs(m_linkCost - adjacent.getLinkCost()) <
-          std::numeric_limits<double>::epsilon()) ;
+          std::numeric_limits<double>::epsilon());
 }
 
 void
 Adjacent::writeLog()
 {
   _LOG_DEBUG("Adjacent : " << m_name);
-  _LOG_DEBUG("Connecting FaceUri: " << m_connectingFaceUri);
+  _LOG_DEBUG("Connecting FaceUri: " << m_faceUri);
   _LOG_DEBUG("Link Cost: " << m_linkCost);
   _LOG_DEBUG("Status: " << m_status);
   _LOG_DEBUG("Interest Timed out: " << m_interestTimedOutNo);
diff --git a/src/adjacent.hpp b/src/adjacent.hpp
index d1995cf..4aded01 100644
--- a/src/adjacent.hpp
+++ b/src/adjacent.hpp
@@ -16,14 +16,13 @@
  *
  * 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 <string>
 #include <cmath>
 #include <boost/cstdint.hpp>
+
 #include <ndn-cxx/face.hpp>
+#include <ndn-cxx/util/face-uri.hpp>
 
 #ifndef NLSR_ADJACENT_HPP
 #define NLSR_ADJACENT_HPP
@@ -45,7 +44,7 @@
 
   Adjacent(const ndn::Name& an);
 
-  Adjacent(const ndn::Name& an, const std::string& cfu,  double lc,
+  Adjacent(const ndn::Name& an, const ndn::util::FaceUri& faceUri, double lc,
            Status s, uint32_t iton, uint64_t faceId);
 
   const ndn::Name&
@@ -60,16 +59,16 @@
     m_name = an;
   }
 
-  const std::string&
-  getConnectingFaceUri() const
+  const ndn::util::FaceUri&
+  getFaceUri() const
   {
-    return m_connectingFaceUri;
+    return m_faceUri;
   }
 
   void
-  setConnectingFaceUri(const std::string& cfu)
+  setFaceUri(const ndn::util::FaceUri& faceUri)
   {
-    m_connectingFaceUri = cfu;
+    m_faceUri = faceUri;
   }
 
   uint64_t
@@ -131,15 +130,15 @@
   }
 
   inline bool
-  compareFaceId(uint64_t faceId)
+  compareFaceId(const uint64_t faceId)
   {
     return m_faceId == faceId;
   }
 
   inline bool
-  compareFaceUri(std::string& faceUri)
+  compareFaceUri(const ndn::util::FaceUri& faceUri)
   {
-    return m_connectingFaceUri == faceUri;
+    return m_faceUri == faceUri;
   }
 
   void
@@ -150,7 +149,7 @@
 
 private:
   ndn::Name m_name;
-  std::string m_connectingFaceUri;
+  ndn::util::FaceUri m_faceUri;
   double m_linkCost;
   Status m_status;
   uint32_t m_interestTimedOutNo;
@@ -159,4 +158,4 @@
 
 } // namespace nlsr
 
-#endif //NLSR_ADJACENT_HPP
+#endif // NLSR_ADJACENT_HPP
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index 70600fb..211609a 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -474,12 +474,13 @@
       try {
         ConfigSection CommandAttriTree = tn->second;
         std::string name = CommandAttriTree.get<std::string>("name");
-        std::string faceUri = CommandAttriTree.get<std::string>("face-uri");
+        std::string uriString = CommandAttriTree.get<std::string>("face-uri");
 
-        ndn::util::FaceUri uri;
-
-        if (!uri.parse(faceUri)) {
-          std::cerr << "Malformed face-uri <" << faceUri << "> for " << name << std::endl;
+        ndn::util::FaceUri faceUri;
+        try {
+          faceUri = ndn::util::FaceUri(uriString);
+        } catch (ndn::util::FaceUri::Error e) {
+          std::cerr << "Malformed face-uri <" << uriString << "> for " << name << std::endl;
           return false;
         }
 
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 2f27020..52e8997 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -72,7 +72,7 @@
     // successful registration prompts a callback that sends the hello
     // Interest to the new Face.
     else {
-      registerPrefixes((*it).getName(), (*it).getConnectingFaceUri(),
+      registerPrefixes((*it).getName(), (*it).getFaceUri().toString(),
                        (*it).getLinkCost(), ndn::time::milliseconds::max());
     }
   }
@@ -129,7 +129,7 @@
       // If the originator of the Interest currently lacks a Face, we
       // need to give it one.
       else {
-        registerPrefixes(adjacent->getName(), adjacent->getConnectingFaceUri(),
+        registerPrefixes(adjacent->getName(), adjacent->getFaceUri().toString(),
                          adjacent->getLinkCost(), ndn::time::milliseconds::max());
       }
     }
@@ -262,7 +262,7 @@
     adjacent->setFaceId(commandSuccessResult.getFaceId());
     ndn::Name broadcastKeyPrefix = DEFAULT_BROADCAST_PREFIX;
     broadcastKeyPrefix.append("KEYS");
-    std::string faceUri = adjacent->getConnectingFaceUri();
+    std::string faceUri = adjacent->getFaceUri().toString();
     double linkCost = adjacent->getLinkCost();
     m_nlsr.getFib().registerPrefix(m_nlsr.getConfParameter().getChronosyncPrefix(),
                                  faceUri, linkCost, timeout,
diff --git a/src/lsa.cpp b/src/lsa.cpp
index 46dc1c4..78e5837 100644
--- a/src/lsa.cpp
+++ b/src/lsa.cpp
@@ -253,7 +253,7 @@
   os << m_origRouter << "|" << AdjLsa::TYPE_STRING << "|" << m_lsSeqNo << "|"
      << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_adl.getSize();
   for (const auto& adjacent : m_adl.getAdjList()) {
-    os << "|" << adjacent.getName() << "|" << adjacent.getConnectingFaceUri()
+    os << "|" << adjacent.getName() << "|" << adjacent.getFaceUri()
        << "|" << adjacent.getLinkCost();
   }
   os << "|";
@@ -290,7 +290,8 @@
       ndn::Name adjName(*tok_iter++);
       std::string connectingFaceUri(*tok_iter++);
       double linkCost = boost::lexical_cast<double>(*tok_iter++);
-      Adjacent adjacent(adjName, connectingFaceUri, linkCost, Adjacent::STATUS_INACTIVE, 0, 0);
+      Adjacent adjacent(adjName, ndn::util::FaceUri(connectingFaceUri), linkCost,
+                        Adjacent::STATUS_INACTIVE, 0, 0);
       addAdjacent(adjacent);
     }
     catch (const std::exception& e) {
@@ -342,7 +343,7 @@
   for (const Adjacent& adjacency : adjLsa) {
   os << "    Adjacent " << adjacencyIndex++ << ":\n"
      << "      Adjacent Name: " << adjacency.getName() << "\n"
-     << "      Connecting FaceUri: " << adjacency.getConnectingFaceUri() << "\n"
+     << "      Connecting FaceUri: " << adjacency.getFaceUri() << "\n"
      << "      Link Cost: " << adjacency.getLinkCost() << "\n";
   }
   os << "adj_lsa_end";
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index f00bbe1..02df4aa 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -198,15 +198,15 @@
                            std::function<void(std::list<Adjacent>::iterator)> then)
 {
   if (currentNeighbor != m_adjacencyList.getAdjList().end()) {
-    ndn::util::FaceUri uri(currentNeighbor->getConnectingFaceUri());
+    ndn::util::FaceUri uri(currentNeighbor->getFaceUri());
     uri.canonize([this, then, currentNeighbor] (ndn::util::FaceUri canonicalUri) {
-        _LOG_DEBUG("Canonized URI: " << currentNeighbor->getConnectingFaceUri()
+        _LOG_DEBUG("Canonized URI: " << currentNeighbor->getFaceUri()
                    << " to: " << canonicalUri);
-        currentNeighbor->setConnectingFaceUri(canonicalUri.toString());
+        currentNeighbor->setFaceUri(canonicalUri);
         then(std::next(currentNeighbor));
       },
       [this, then, currentNeighbor] (const std::string& reason) {
-        _LOG_ERROR("Could not canonize URI: " << currentNeighbor->getConnectingFaceUri()
+        _LOG_ERROR("Could not canonize URI: " << currentNeighbor->getFaceUri()
                    << " because: " << reason);
         then(std::next(currentNeighbor));
       },
@@ -388,7 +388,7 @@
   std::list<Adjacent>& adjacents = m_adjacencyList.getAdjList();
   for (std::list<Adjacent>::iterator it = adjacents.begin();
        it != adjacents.end(); it++) {
-    m_fib.destroyFace((*it).getConnectingFaceUri(),
+    m_fib.destroyFace((*it).getFaceUri().toString(),
                       std::bind(&Nlsr::onDestroyFaceSuccess, this, _1),
                       std::bind(&Nlsr::onDestroyFaceFailure, this, _1));
   }
diff --git a/src/publisher/lsa-publisher.cpp b/src/publisher/lsa-publisher.cpp
index 3d16581..7060c05 100644
--- a/src/publisher/lsa-publisher.cpp
+++ b/src/publisher/lsa-publisher.cpp
@@ -52,7 +52,7 @@
     for (const Adjacent& adj : lsa.getAdl().getAdjList()) {
       tlv::Adjacency tlvAdj;
       tlvAdj.setName(adj.getName());
-      tlvAdj.setUri(adj.getConnectingFaceUri());
+      tlvAdj.setUri(adj.getFaceUri().toString());
       tlvAdj.setCost(adj.getLinkCost());
       tlvLsa.addAdjacency(tlvAdj);
     }
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 777ab1b..c4ddad8 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -266,7 +266,7 @@
                     uint64_t faceCost, const ndn::time::milliseconds& timeout,
                     uint64_t flags, uint8_t times)
 {
-  uint64_t faceId = m_adjacencyList.getFaceId(faceUri);
+  uint64_t faceId = m_adjacencyList.getFaceId(ndn::util::FaceUri(faceUri));
   if (faceId != 0) {
     ndn::nfd::ControlParameters faceParameters;
     faceParameters
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index e464c49..54d486d 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -252,7 +252,7 @@
   int v, u;
   int* Q = new int[m_nRouters]; // Each cell represents the router with that mapping no.
   int head = 0;
-  /* Initiate the Parent */
+  // Initiate the Parent
   for (i = 0 ; i < static_cast<int>(m_nRouters); i++) {
     m_parent[i] = EMPTY_PARENT;
     // Array where the ith element is the distance to the router with mapping no i.
@@ -318,7 +318,7 @@
         // Fetch its actual name
         ndn::Name nextHopRouterName = pMap.getRouterNameByMappingNo(nextHopRouter);
         std::string nextHopFace =
-          pnlsr.getAdjacencyList().getAdjacent(nextHopRouterName).getConnectingFaceUri();
+          pnlsr.getAdjacencyList().getAdjacent(nextHopRouterName).getFaceUri().toString();
         // Add next hop to routing table
         NextHop nh(nextHopFace, routeCost);
         rt.addNextHop(pMap.getRouterNameByMappingNo(i), nh);
@@ -426,7 +426,7 @@
       continue;
     }
 
-    std::string srcFaceUri = adj->getConnectingFaceUri();
+    std::string srcFaceUri = adj->getFaceUri().toString();
 
     // Install nexthops for this router to the neighbor; direct neighbors have a 0 cost link
     addNextHop(srcRouterName, srcFaceUri, 0, rt);
@@ -479,7 +479,7 @@
   CoordinateLsa* destLsa = lsdb.findCoordinateLsa(destLsaKey);
 
   // Coordinate LSAs do not exist for these routers
-  if (srcLsa == NULL || destLsa == NULL) {
+  if (srcLsa == nullptr || destLsa == nullptr) {
     return UNKNOWN_DISTANCE;
   }
 
