diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index bd6783c..7fa3e6e 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -59,20 +59,6 @@
   }
 }
 
-bool
-AdjacencyList::updateAdjacentStatus(const ndn::Name& adjName, Adjacent::Status s)
-{
-  std::list<Adjacent>::iterator it = find(adjName);
-
-  if (it == m_adjList.end()) {
-    return false;
-  }
-  else {
-    it->setStatus(s);
-    return true;
-  }
-}
-
 Adjacent
 AdjacencyList::getAdjacent(const ndn::Name& adjName)
 {
@@ -97,17 +83,6 @@
   return ourList == theirList;
 }
 
-int32_t
-AdjacencyList::updateAdjacentLinkCost(const ndn::Name& adjName, double lc)
-{
-  std::list<Adjacent>::iterator it = find(adjName);
-  if (it == m_adjList.end()) {
-    return -1;
-  }
-  (*it).setLinkCost(lc);
-  return 0;
-}
-
 bool
 AdjacencyList::isNeighbor(const ndn::Name& adjName) const
 {
diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index 61205c8..3b82a7c 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.hpp
@@ -52,21 +52,6 @@
   int32_t
   insert(Adjacent& adjacent);
 
-  /*! \brief Sets the status of an adjacency.
-
-    \param adjName The adjacency in this list you want to change the status of.
-
-    \param s The status to change to.
-
-    \return A boolean indicating whether an adjacency was
-    updated. This is false if s is not in the list.
-   */
-  bool
-  updateAdjacentStatus(const ndn::Name& adjName, Adjacent::Status s);
-
-  int32_t
-  updateAdjacentLinkCost(const ndn::Name& adjName, double lc);
-
   std::list<Adjacent>&
   getAdjList();
 
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index cac002a..549d353 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -303,18 +303,6 @@
   }
 
   void
-  setLogLevel(const std::string& logLevel)
-  {
-    m_logLevel = logLevel;
-  }
-
-  const std::string&
-  getLogLevel() const
-  {
-    return m_logLevel;
-  }
-
-  void
   setInterestRetryNumber(uint32_t irn)
   {
     m_interestRetryNumber = irn;
diff --git a/src/lsa-segment-storage.cpp b/src/lsa-segment-storage.cpp
index a567aab..fa656d3 100644
--- a/src/lsa-segment-storage.cpp
+++ b/src/lsa-segment-storage.cpp
@@ -47,7 +47,7 @@
 {
   ndn::Name lsaSegmentsKey = interest.getName();
 
-  // If this the first interest then it does not contain the segment number,
+  // If this is the first interest then it does not contain the segment number,
   // so need to append zero segment component at the end to match with the data
   if (lsaSegmentsKey.size() > 0) {
     if (!lsaSegmentsKey.get(-1).isSegment()) {
@@ -142,17 +142,4 @@
                             });
 }
 
-void
-LsaSegmentStorage::insertSegment(const ndn::Name& segmentKey,
-                                 const ndn::Data& segmentValue)
-{
-  m_lsaSegments[segmentKey] = segmentValue;
-}
-
-void
-LsaSegmentStorage::deleteSegment(const ndn::Name& segmentKey)
-{
-  m_lsaSegments.erase(segmentKey);
-}
-
-} // namespace nlsr
\ No newline at end of file
+} // namespace nlsr
diff --git a/src/lsa-segment-storage.hpp b/src/lsa-segment-storage.hpp
index bc98f25..468b2fe 100644
--- a/src/lsa-segment-storage.hpp
+++ b/src/lsa-segment-storage.hpp
@@ -51,20 +51,6 @@
   const ndn::Data*
   getLsaSegment(const ndn::Interest& interest);
 
-  /*! \brief Inserts an LSA segment into LsaSegmentStorage
-   * \param segmentKey Name of data without the version number.
-   * The format of the key is /router-prefix/LS type/sequence no./segment no.
-   * \param segmentValue The actual data packet.
-   */
-  void
-  insertSegment(const ndn::Name& segmentKey, const ndn::Data& segmentValue);
-
-  /*! \brief Given the key remove the corresponding data packet from LsaSegmentStorage.
-   * \param segmentKey Key of the Data packet that will be deleted.
-   */
-  void
-  deleteSegment(const ndn::Name& segmentKey);
-
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /*! \brief Callback when SegmentFetcher retrieves a segment.
    */
@@ -99,4 +85,4 @@
 
 } // namespace nlsr
 
-#endif // NLSR_LSA_SEGMENT_STORAGE_HPP
\ No newline at end of file
+#endif // NLSR_LSA_SEGMENT_STORAGE_HPP
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 14c8842..f3eb899 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -197,7 +197,8 @@
   }
 
   LsaSegmentStorage&
-  getLsaStorage() {
+  getLsaStorage()
+  {
     return m_lsaStorage;
   }
 
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index ebc469d..384d4e9 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -142,7 +142,6 @@
 void
 Nlsr::setStrategies()
 {
-  NLSR_LOG_TRACE("in setStrategies");
   const std::string strategy("ndn:/localhost/nfd/strategy/multicast");
 
   m_fib.setStrategy(m_confParam.getLsaPrefix(), strategy, 0);
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index d2e8527..dee3630 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -48,12 +48,6 @@
   m_afterRoutingChangeConnection.disconnect();
 }
 
-bool
-npteCompare(std::shared_ptr<NamePrefixTableEntry>& npte, const ndn::Name& name)
-{
-  return npte->getNamePrefix() == name;
-}
-
 void
 NamePrefixTable::addEntry(const ndn::Name& name, const ndn::Name& destRouter)
 {
diff --git a/src/route/name-prefix-table.hpp b/src/route/name-prefix-table.hpp
index 1e11e15..aa55c9e 100644
--- a/src/route/name-prefix-table.hpp
+++ b/src/route/name-prefix-table.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-2018,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -140,9 +140,6 @@
   return m_table.end();
 }
 
-bool
-npteCompare(NamePrefixTableEntry& npte, const ndn::Name& name);
-
 std::ostream&
 operator<<(std::ostream& os, const NamePrefixTable& table);
 
diff --git a/tests/update/test-prefix-update-processor.cpp b/tests/update/test-prefix-update-processor.cpp
index 70d18c9..4fdf19b 100644
--- a/tests/update/test-prefix-update-processor.cpp
+++ b/tests/update/test-prefix-update-processor.cpp
@@ -170,20 +170,6 @@
     return (it != face.sentData.end());
   }
 
-  void
-  checkResponseCode(const Name& commandPrefix, uint64_t expectedCode)
-  {
-    std::vector<Data>::iterator it = std::find_if(face.sentData.begin(),
-                                                  face.sentData.end(),
-                                                  [commandPrefix] (const Data& data) {
-                                                    return commandPrefix.isPrefixOf(data.getName());
-                                                  });
-    BOOST_REQUIRE(it != face.sentData.end());
-
-    ndn::nfd::ControlResponse response(it->getContent().blockFromValue());
-    BOOST_CHECK_EQUAL(response.getCode(), expectedCode);
-  }
-
 public:
   ndn::util::DummyClientFace face;
 
