diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index fd2fd46..56807c7 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -240,32 +240,22 @@
   return it;
 }
 
-Adjacent *
+AdjacencyList::iterator
 AdjacencyList::findAdjacent(const ndn::Name& adjName)
 {
-  std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
-                                                  m_adjList.end(),
-                                                  std::bind(&Adjacent::compare,
-                                                            _1, std::cref(adjName)));
-  if (it != m_adjList.end()) {
-    return &(*it);
-  }
-
-  return 0;
+  return std::find_if(m_adjList.begin(),
+                      m_adjList.end(),
+                      std::bind(&Adjacent::compare,
+                                _1, std::cref(adjName)));
 }
 
-Adjacent *
+AdjacencyList::iterator
 AdjacencyList::findAdjacent(uint64_t faceId)
 {
-  std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
-                                                  m_adjList.end(),
-                                                  std::bind(&Adjacent::compareFaceId,
-                                                            _1, faceId));
-  if (it != m_adjList.end()) {
-    return &(*it);
-  }
-
-  return 0;
+  return std::find_if(m_adjList.begin(),
+                      m_adjList.end(),
+                      std::bind(&Adjacent::compareFaceId,
+                                _1, faceId));
 }
 
 uint64_t
diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index 4cf816e..c9553de 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.hpp
@@ -139,10 +139,10 @@
     }
   }
 
-  Adjacent*
+  AdjacencyList::iterator
   findAdjacent(const ndn::Name& adjName);
 
-  Adjacent*
+  AdjacencyList::iterator
   findAdjacent(uint64_t faceId);
 
   uint64_t
@@ -173,4 +173,4 @@
 };
 
 } // namespace nlsr
-#endif //NLSR_ADJACENCY_LIST_HPP
+#endif // NLSR_ADJACENCY_LIST_HPP
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 684009d..2f27020 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -112,7 +112,8 @@
     m_nlsr.getKeyChain().sign(*data, m_nlsr.getDefaultCertName());
     _LOG_DEBUG("Sending out data for name: " << interest.getName());
     m_nlsr.getNlsrFace().put(*data);
-    Adjacent* adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor);
+
+    auto adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor);
     // If this neighbor was previously inactive, send our own hello interest, too
     if (adjacent->getStatus() == Adjacent::STATUS_INACTIVE) {
       // We can only do that if the neighbor currently has a face.
@@ -256,8 +257,8 @@
 HelloProtocol::onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
                                      const ndn::Name& neighbor,const ndn::time::milliseconds& timeout)
 {
-  Adjacent* adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor);
-  if (adjacent != 0) {
+  auto adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor);
+  if (adjacent != m_nlsr.getAdjacencyList().end()){
     adjacent->setFaceId(commandSuccessResult.getFaceId());
     ndn::Name broadcastKeyPrefix = DEFAULT_BROADCAST_PREFIX;
     broadcastKeyPrefix.append("KEYS");
@@ -296,8 +297,8 @@
   * Lsa unless all the neighbors are ACTIVE or DEAD. For considering the
   * missconfigured(link) neighbour dead this is required.
   */
-  Adjacent* adjacent = m_nlsr.getAdjacencyList().findAdjacent(name);
-  if (adjacent != 0) {
+  auto adjacent = m_nlsr.getAdjacencyList().findAdjacent(name);
+  if (adjacent != m_nlsr.getAdjacencyList().end()) {
     adjacent->setInterestTimedOutNo(adjacent->getInterestTimedOutNo() + 1);
     Adjacent::Status status = adjacent->getStatus();
     uint32_t infoIntTimedOutCount = adjacent->getInterestTimedOutNo();
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 26276d7..2bcc157 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -375,9 +375,9 @@
   if (kind == ndn::nfd::FACE_EVENT_DESTROYED) {
     uint64_t faceId = faceEventNotification.getFaceId();
 
-    Adjacent* adjacent = m_adjacencyList.findAdjacent(faceId);
+    auto adjacent = m_adjacencyList.findAdjacent(faceId);
 
-    if (adjacent != nullptr) {
+    if (adjacent != m_adjacencyList.end()) {
       _LOG_DEBUG("Face to " << adjacent->getName() << " with face id: " << faceId << " destroyed");
 
       adjacent->setFaceId(0);
diff --git a/tests/test-link-state-calculator.cpp b/tests/test-link-state-calculator.cpp
index f4fffb6..6bbf472 100644
--- a/tests/test-link-state-calculator.cpp
+++ b/tests/test-link-state-calculator.cpp
@@ -179,8 +179,8 @@
   AdjLsa* lsa = nlsr.getLsdb().findAdjLsa(key);
   BOOST_REQUIRE(lsa != nullptr);
 
-  Adjacent* c = lsa->getAdl().findAdjacent(ROUTER_C_NAME);
-  BOOST_REQUIRE(c != nullptr);
+  auto c = lsa->getAdl().findAdjacent(ROUTER_C_NAME);
+  BOOST_REQUIRE(c != nlsr.getAdjacencyList().end());
 
   double higherLinkCost = LINK_BC_COST + 1;
   c->setLinkCost(higherLinkCost);
@@ -228,8 +228,8 @@
   AdjLsa* lsa = nlsr.getLsdb().findAdjLsa(key);
   BOOST_REQUIRE(lsa != nullptr);
 
-  Adjacent* c = lsa->getAdl().findAdjacent(ROUTER_C_NAME);
-  BOOST_REQUIRE(c != nullptr);
+  auto c = lsa->getAdl().findAdjacent(ROUTER_C_NAME);
+  BOOST_REQUIRE(c != nlsr.getAdjacencyList().end());
 
   c->setLinkCost(0);
 
