diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 789edf6..480248e 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -366,7 +366,7 @@
 }
 
 const std::list<NameLsa>&
-Lsdb::getNameLsdb()
+Lsdb::getNameLsdb() const
 {
   return m_nameLsdb;
 }
@@ -567,7 +567,7 @@
 }
 
 const std::list<CoordinateLsa>&
-Lsdb::getCoordinateLsdb()
+Lsdb::getCoordinateLsdb() const
 {
   return m_corLsdb;
 }
@@ -805,7 +805,7 @@
 }
 
 const std::list<AdjLsa>&
-Lsdb::getAdjLsdb()
+Lsdb::getAdjLsdb() const
 {
   return m_adjLsdb;
 }
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 4574242..3a63e68 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -95,7 +95,7 @@
   writeNameLsdbLog();
 
   const std::list<NameLsa>&
-  getNameLsdb();
+  getNameLsdb() const;
 
   /*! \brief Builds a cor. LSA for this router and installs it into the LSDB. */
   bool
@@ -134,7 +134,7 @@
   writeCorLsdbLog();
 
   const std::list<CoordinateLsa>&
-  getCoordinateLsdb();
+  getCoordinateLsdb() const;
 
   //function related to Adj LSDB
 
@@ -175,7 +175,7 @@
   findAdjLsa(const ndn::Name& key);
 
   const std::list<AdjLsa>&
-  getAdjLsdb();
+  getAdjLsdb() const;
 
   void
   setAdjLsaBuildInterval(uint32_t interval)
diff --git a/src/publisher/lsa-publisher.cpp b/src/publisher/lsa-publisher.cpp
deleted file mode 100644
index 6bfc1dc..0000000
--- a/src/publisher/lsa-publisher.cpp
+++ /dev/null
@@ -1,137 +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,
- *                           Arizona Board of Regents.
- *
- * 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/>.
- **/
-
-#include "lsa-publisher.hpp"
-
-#include "lsa.hpp"
-
-#include <ndn-cxx/face.hpp>
-
-namespace nlsr {
-
-const ndn::Name::Component AdjacencyLsaPublisher::DATASET_COMPONENT =
-  ndn::Name::Component("adjacencies");
-
-AdjacencyLsaPublisher::AdjacencyLsaPublisher(Lsdb& lsdb,
-                                             ndn::Face& face,
-                                             ndn::KeyChain& keyChain)
-  : m_adjacencyLsas(lsdb.getAdjLsdb())
-{
-}
-
-std::list<tlv::AdjacencyLsa>
-AdjacencyLsaPublisher::getTlvLsas()
-{
-  std::list<tlv::AdjacencyLsa> lsas;
-
-  for (AdjLsa lsa : m_adjacencyLsas) {
-    tlv::AdjacencyLsa tlvLsa;
-
-    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(lsa);
-    tlvLsa.setLsaInfo(*tlvLsaInfo);
-
-    for (const Adjacent& adj : lsa.getAdl().getAdjList()) {
-      tlv::Adjacency tlvAdj;
-      tlvAdj.setName(adj.getName());
-      tlvAdj.setUri(adj.getFaceUri().toString());
-      tlvAdj.setCost(adj.getLinkCost());
-      tlvLsa.addAdjacency(tlvAdj);
-    }
-
-    lsas.push_back(tlvLsa);
-  }
-
-  return lsas;
-}
-
-//////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////
-
-const ndn::Name::Component CoordinateLsaPublisher::DATASET_COMPONENT =
-  ndn::Name::Component("coordinates");
-
-CoordinateLsaPublisher::CoordinateLsaPublisher(Lsdb& lsdb,
-                                               ndn::Face& face,
-                                               ndn::KeyChain& keyChain)
-  : m_coordinateLsas(lsdb.getCoordinateLsdb())
-{
-}
-
-  // Returns the list of coordinate LSAs represented by this object.
-std::list<tlv::CoordinateLsa>
-CoordinateLsaPublisher::getTlvLsas()
-{
-  std::list<tlv::CoordinateLsa> lsas;
-
-  for (const CoordinateLsa lsa : m_coordinateLsas) {
-    tlv::CoordinateLsa tlvLsa;
-
-    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(lsa);
-    tlvLsa.setLsaInfo(*tlvLsaInfo);
-
-    tlvLsa.setHyperbolicRadius(lsa.getCorRadius());
-    tlvLsa.setHyperbolicAngle(lsa.getCorTheta());
-
-    lsas.push_back(tlvLsa);
-  }
-
-  return lsas;
-}
-
-//////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////
-
-const ndn::Name::Component NameLsaPublisher::DATASET_COMPONENT =
-  ndn::Name::Component("names");
-
-NameLsaPublisher::NameLsaPublisher(Lsdb& lsdb,
-                                   ndn::Face& face,
-                                   ndn::KeyChain& keyChain)
-  : m_nameLsas(lsdb.getNameLsdb())
-{
-}
-
-  // Returns the list of name LSAs represented by this object.
-  // Note: each name LSA has a list of prefixes as well.
-std::list<tlv::NameLsa>
-NameLsaPublisher::getTlvLsas()
-{
-  std::list<tlv::NameLsa> lsas;
-
-  for (NameLsa lsa : m_nameLsas) {
-    tlv::NameLsa tlvLsa;
-
-    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(lsa);
-    tlvLsa.setLsaInfo(*tlvLsaInfo);
-
-    for (const ndn::Name& name : lsa.getNpl().getNames()) {
-      tlvLsa.addName(name);
-    }
-
-    lsas.push_back(tlvLsa);
-  }
-
-  return lsas;
-}
-
-} // namespace nlsr
diff --git a/src/publisher/lsa-publisher.hpp b/src/publisher/lsa-publisher.hpp
deleted file mode 100644
index 6726b5a..0000000
--- a/src/publisher/lsa-publisher.hpp
+++ /dev/null
@@ -1,108 +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,
- *                           Arizona Board of Regents.
- *
- * 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_PUBLISHER_LSA_PUBLISHER_HPP
-#define NLSR_PUBLISHER_LSA_PUBLISHER_HPP
-
-#include "lsdb.hpp"
-#include "segment-publisher.hpp"
-#include "tlv/adjacency-lsa.hpp"
-#include "tlv/coordinate-lsa.hpp"
-#include "tlv/name-lsa.hpp"
-
-#include <ndn-cxx/face.hpp>
-
-namespace nlsr {
-
-  /*! \brief Class to publish adjacency lsa dataset
-
-    \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
-
-  */
-class AdjacencyLsaPublisher
-{
-public:
-  AdjacencyLsaPublisher(Lsdb& lsdb,
-                        ndn::Face& face,
-                        ndn::KeyChain& keyChain);
-
-  /*! \brief Generates an TLV-format AdjacencyLsa from AdjacencyLsas
-   * and their Adjacents.
-   */
-  std::list<tlv::AdjacencyLsa>
-  getTlvLsas();
-
-public:
-  static const ndn::Name::Component DATASET_COMPONENT;
-
-private:
-  const std::list<AdjLsa>& m_adjacencyLsas;
-};
-
-  /*! \brief Class to publish coordinate lsa dataset
-    \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
-  */
-class CoordinateLsaPublisher
-{
-public:
-  CoordinateLsaPublisher(Lsdb& lsdb,
-                        ndn::Face& face,
-                        ndn::KeyChain& keyChain);
-
-  /*! \brief Generates a TLV-format CoordinateLsa from CoordinateLsas
-   * and their hyperbolic coordinates.
-   */
-  std::list<tlv::CoordinateLsa>
-  getTlvLsas();
-
-public:
-  static const ndn::Name::Component DATASET_COMPONENT;
-
-private:
-  const std::list<CoordinateLsa>& m_coordinateLsas;
-};
-
-  /*! \brief Class to publish name lsa dataset
-    \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
-  */
-class NameLsaPublisher
-{
-public:
-  NameLsaPublisher(Lsdb& lsdb,
-                   ndn::Face& face,
-                   ndn::KeyChain& keyChain);
-
-  /*! \brief Generates a TLV-format NameLsa from NameLsas and their
-   * list of name prefixes.
-   */
-  std::list<tlv::NameLsa>
-  getTlvLsas();
-
-public:
-  static const ndn::Name::Component DATASET_COMPONENT;
-
-private:
-  const std::list<NameLsa>& m_nameLsas;
-};
-
-} // namespace nlsr
-
-#endif // NLSR_PUBLISHER_LSA_PUBLISHER_HPP
diff --git a/src/publisher/lsdb-dataset-interest-handler.cpp b/src/publisher/lsdb-dataset-interest-handler.cpp
index 30634ac..7a4ba1c 100644
--- a/src/publisher/lsdb-dataset-interest-handler.cpp
+++ b/src/publisher/lsdb-dataset-interest-handler.cpp
@@ -27,9 +27,10 @@
  */
 
 #include "lsdb-dataset-interest-handler.hpp"
-#include "logger.hpp"
+
 #include "nlsr.hpp"
 #include "tlv/lsdb-status.hpp"
+#include "logger.hpp"
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/mgmt/nfd/control-response.hpp>
@@ -49,14 +50,9 @@
                                                        ndn::mgmt::Dispatcher& routerNameDispatcher,
                                                        ndn::Face& face,
                                                        ndn::KeyChain& keyChain)
-  : m_localhostDispatcher(localHostDispatcher)
+  : m_lsdb(lsdb)
+  , m_localhostDispatcher(localHostDispatcher)
   , m_routerNameDispatcher(routerNameDispatcher)
-  , m_adjacencyLsaPublisher(lsdb, face, keyChain)
-  , m_coordinateLsaPublisher(lsdb, face, keyChain)
-  , m_nameLsaPublisher(lsdb, face, keyChain)
-  , m_adjacencyLsas(lsdb.getAdjLsdb())
-  , m_coordinateLsas(lsdb.getCoordinateLsdb())
-  , m_nameLsas(lsdb.getNameLsdb())
 {
   _LOG_DEBUG("Setting dispatcher for lsdb status dataset:");
   setDispatcher(m_localhostDispatcher);
@@ -85,12 +81,16 @@
                                              ndn::mgmt::StatusDatasetContext& context)
 {
   _LOG_DEBUG("Received interest:  " << interest);
-  for (AdjLsa lsa : m_adjacencyLsas) {
+
+  auto lsaRange = std::make_pair<std::list<AdjLsa>::const_iterator,
+                                 std::list<AdjLsa>::const_iterator>(
+    m_lsdb.getAdjLsdb().cbegin(), m_lsdb.getAdjLsdb().cend());
+  for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
     tlv::AdjacencyLsa tlvLsa;
-    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(lsa);
+    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(*lsa);
     tlvLsa.setLsaInfo(*tlvLsaInfo);
 
-    for (const Adjacent& adj : lsa.getAdl().getAdjList()) {
+    for (const Adjacent& adj : lsa->getAdl().getAdjList()) {
       tlv::Adjacency tlvAdj;
       tlvAdj.setName(adj.getName());
       tlvAdj.setUri(adj.getFaceUri().toString());
@@ -107,14 +107,18 @@
 LsdbDatasetInterestHandler::publishCoordinateStatus(const ndn::Name& topPrefix, const ndn::Interest& interest,
                                                     ndn::mgmt::StatusDatasetContext& context)
 {
+  auto lsaRange = std::make_pair<std::list<CoordinateLsa>::const_iterator,
+                                 std::list<CoordinateLsa>::const_iterator>(
+    m_lsdb.getCoordinateLsdb().cbegin(), m_lsdb.getCoordinateLsdb().cend());
+
   _LOG_DEBUG("Received interest:  " << interest);
-  for (const CoordinateLsa lsa : m_coordinateLsas) {
+  for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
     tlv::CoordinateLsa tlvLsa;
-    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(lsa);
+    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(*lsa);
     tlvLsa.setLsaInfo(*tlvLsaInfo);
 
-    tlvLsa.setHyperbolicRadius(lsa.getCorRadius());
-    tlvLsa.setHyperbolicAngle(lsa.getCorTheta());
+    tlvLsa.setHyperbolicRadius(lsa->getCorRadius());
+    tlvLsa.setHyperbolicAngle(lsa->getCorTheta());
 
     const ndn::Block& wire = tlvLsa.wireEncode();
     context.append(wire);
@@ -126,14 +130,16 @@
 LsdbDatasetInterestHandler::publishNameStatus(const ndn::Name& topPrefix, const ndn::Interest& interest,
                                               ndn::mgmt::StatusDatasetContext& context)
 {
+  auto lsaRange = std::make_pair<std::list<NameLsa>::const_iterator, std::list<NameLsa>::const_iterator>(
+    m_lsdb.getNameLsdb().cbegin(), m_lsdb.getNameLsdb().cend());
   _LOG_DEBUG("Received interest:  " << interest);
-  for (NameLsa lsa : m_nameLsas) {
+  for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
     tlv::NameLsa tlvLsa;
 
-    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(lsa);
+    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(*lsa);
     tlvLsa.setLsaInfo(*tlvLsaInfo);
 
-    for (const ndn::Name& name : lsa.getNpl().getNames()) {
+    for (const ndn::Name& name : lsa->getNpl().getNames()) {
       tlvLsa.addName(name);
     }
 
@@ -149,15 +155,15 @@
 {
   _LOG_DEBUG("Received interest:  " << interest);
   tlv::LsdbStatus lsdbStatus;
-  for (const tlv::AdjacencyLsa& tlvLsa : m_adjacencyLsaPublisher.getTlvLsas()) {
+  for (const tlv::AdjacencyLsa& tlvLsa : getTlvLsas<tlv::AdjacencyLsa>(m_lsdb)) {
     lsdbStatus.addAdjacencyLsa(tlvLsa);
   }
 
-  for (const tlv::CoordinateLsa& tlvLsa : m_coordinateLsaPublisher.getTlvLsas()) {
+  for (const tlv::CoordinateLsa& tlvLsa : getTlvLsas<tlv::CoordinateLsa>(m_lsdb)) {
     lsdbStatus.addCoordinateLsa(tlvLsa);
   }
 
-  for (const tlv::NameLsa& tlvLsa : m_nameLsaPublisher.getTlvLsas()) {
+  for (const tlv::NameLsa& tlvLsa : getTlvLsas<tlv::NameLsa>(m_lsdb)) {
     lsdbStatus.addNameLsa(tlvLsa);
   }
   const ndn::Block& wire = lsdbStatus.wireEncode();
@@ -165,4 +171,84 @@
   context.end();
 }
 
+template<> std::list<tlv::AdjacencyLsa>
+getTlvLsas<tlv::AdjacencyLsa>(const Lsdb& lsdb)
+{
+  std::list<tlv::AdjacencyLsa> lsas;
+
+  auto lsaRange = std::make_pair<std::list<AdjLsa>::const_iterator,
+                                 std::list<AdjLsa>::const_iterator>(
+    lsdb.getAdjLsdb().cbegin(), lsdb.getAdjLsdb().cend());
+  for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
+    tlv::AdjacencyLsa tlvLsa;
+
+    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(*lsa);
+    tlvLsa.setLsaInfo(*tlvLsaInfo);
+
+    for (const Adjacent& adj : lsa->getAdl().getAdjList()) {
+      tlv::Adjacency tlvAdj;
+      tlvAdj.setName(adj.getName());
+      tlvAdj.setUri(adj.getFaceUri().toString());
+      tlvAdj.setCost(adj.getLinkCost());
+      tlvLsa.addAdjacency(tlvAdj);
+    }
+
+    lsas.push_back(tlvLsa);
+  }
+
+  return lsas;
+
+}
+
+template<> std::list<tlv::CoordinateLsa>
+getTlvLsas<tlv::CoordinateLsa>(const Lsdb& lsdb)
+{
+  std::list<tlv::CoordinateLsa> lsas;
+
+  auto lsaRange = std::make_pair<std::list<CoordinateLsa>::const_iterator,
+                                 std::list<CoordinateLsa>::const_iterator>(
+    lsdb.getCoordinateLsdb().cbegin(), lsdb.getCoordinateLsdb().cend());
+
+  for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
+    tlv::CoordinateLsa tlvLsa;
+
+    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(*lsa);
+    tlvLsa.setLsaInfo(*tlvLsaInfo);
+
+    tlvLsa.setHyperbolicRadius(lsa->getCorRadius());
+    tlvLsa.setHyperbolicAngle(lsa->getCorTheta());
+
+    lsas.push_back(tlvLsa);
+  }
+
+  return lsas;
+
+}
+
+template<> std::list<tlv::NameLsa>
+getTlvLsas<tlv::NameLsa>(const Lsdb& lsdb)
+{
+  std::list<tlv::NameLsa> lsas;
+
+  auto lsaRange = std::make_pair<std::list<NameLsa>::const_iterator,
+                                 std::list<NameLsa>::const_iterator>(
+    lsdb.getNameLsdb().cbegin(), lsdb.getNameLsdb().cend());
+  for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
+    tlv::NameLsa tlvLsa;
+
+    std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(*lsa);
+    tlvLsa.setLsaInfo(*tlvLsaInfo);
+
+    for (const ndn::Name& name : lsa->getNpl().getNames()) {
+      tlvLsa.addName(name);
+    }
+
+    lsas.push_back(tlvLsa);
+  }
+
+  return lsas;
+
+}
+
+
 } // namespace nlsr
diff --git a/src/publisher/lsdb-dataset-interest-handler.hpp b/src/publisher/lsdb-dataset-interest-handler.hpp
index b92a72f..e01a5da 100644
--- a/src/publisher/lsdb-dataset-interest-handler.hpp
+++ b/src/publisher/lsdb-dataset-interest-handler.hpp
@@ -22,10 +22,10 @@
 #ifndef NLSR_PUBLISHER_LSDB_DATASET_INTEREST_HANDLER_HPP
 #define NLSR_PUBLISHER_LSDB_DATASET_INTEREST_HANDLER_HPP
 
-#include "lsa-publisher.hpp"
 #include "tlv/adjacency-lsa.hpp"
 #include "tlv/coordinate-lsa.hpp"
 #include "tlv/name-lsa.hpp"
+#include "lsdb.hpp"
 
 #include <ndn-cxx/mgmt/dispatcher.hpp>
 #include <ndn-cxx/face.hpp>
@@ -33,6 +33,12 @@
 
 namespace nlsr {
 
+namespace dataset {
+  const ndn::Name::Component ADJACENCY_COMPONENT = ndn::Name::Component{"adjacencies"};
+  const ndn::Name::Component NAME_COMPONENT = ndn::Name::Component{"names"};
+  const ndn::Name::Component COORDINATE_COMPONENT = ndn::Name::Component{"coordinates"};
+} // namespace dataset
+
 /*!
    \brief Class to publish all lsa dataset
    \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
@@ -100,20 +106,25 @@
                    ndn::mgmt::StatusDatasetContext& context);
 
 private:
+  const Lsdb& m_lsdb;
   ndn::Name m_routerNamePrefix;
 
   ndn::mgmt::Dispatcher& m_localhostDispatcher;
   ndn::mgmt::Dispatcher& m_routerNameDispatcher;
-
-  AdjacencyLsaPublisher m_adjacencyLsaPublisher;
-  CoordinateLsaPublisher m_coordinateLsaPublisher;
-  NameLsaPublisher m_nameLsaPublisher;
-
-  const std::list<AdjLsa>& m_adjacencyLsas;
-  const std::list<CoordinateLsa>& m_coordinateLsas;
-  const std::list<NameLsa>& m_nameLsas;
 };
 
+template<typename T> std::list<T>
+getTlvLsas(const Lsdb& lsdb);
+
+template<> std::list<tlv::AdjacencyLsa>
+getTlvLsas<tlv::AdjacencyLsa>(const Lsdb& lsdb);
+
+template<> std::list<tlv::CoordinateLsa>
+getTlvLsas<tlv::CoordinateLsa>(const Lsdb& lsdb);
+
+template<> std::list<tlv::NameLsa>
+getTlvLsas<tlv::NameLsa>(const Lsdb& lsdb);
+
 } // namespace nlsr
 
 #endif // NLSR_PUBLISHER_LSDB_DATASET_INTEREST_HANDLER_HPP
diff --git a/tools/nlsrc.cpp b/tools/nlsrc.cpp
index e60efc2..7612a3e 100644
--- a/tools/nlsrc.cpp
+++ b/tools/nlsrc.cpp
@@ -22,7 +22,7 @@
 #include "nlsrc.hpp"
 
 #include "version.hpp"
-#include "src/publisher/lsa-publisher.hpp"
+#include "src/publisher/lsdb-dataset-interest-handler.hpp"
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/data.hpp>
@@ -192,21 +192,21 @@
 void
 Nlsrc::fetchAdjacencyLsas()
 {
-  fetchFromLsdb<nlsr::tlv::AdjacencyLsa>(nlsr::AdjacencyLsaPublisher::DATASET_COMPONENT,
+  fetchFromLsdb<nlsr::tlv::AdjacencyLsa>(nlsr::dataset::ADJACENCY_COMPONENT,
                                          std::bind(&Nlsrc::recordAdjacencyLsa, this, _1));
 }
 
 void
 Nlsrc::fetchCoordinateLsas()
 {
-  fetchFromLsdb<nlsr::tlv::CoordinateLsa>(nlsr::CoordinateLsaPublisher::DATASET_COMPONENT,
+  fetchFromLsdb<nlsr::tlv::CoordinateLsa>(nlsr::dataset::COORDINATE_COMPONENT,
                                           std::bind(&Nlsrc::recordCoordinateLsa, this, _1));
 }
 
 void
 Nlsrc::fetchNameLsas()
 {
-  fetchFromLsdb<nlsr::tlv::NameLsa>(nlsr::NameLsaPublisher::DATASET_COMPONENT,
+  fetchFromLsdb<nlsr::tlv::NameLsa>(nlsr::dataset::NAME_COMPONENT,
                                     std::bind(&Nlsrc::recordNameLsa, this, _1));
 }
 
