diff --git a/tests/communication/test-sync-logic-handler.cpp b/tests/communication/test-sync-logic-handler.cpp
index eba8064..b94bcb5 100644
--- a/tests/communication/test-sync-logic-handler.cpp
+++ b/tests/communication/test-sync-logic-handler.cpp
@@ -268,8 +268,7 @@
   BOOST_REQUIRE(lsa == nullptr);
 
   // Publish a routing update before an Adjacency LSA is built
-  BOOST_CHECK_NO_THROW(nlsr.m_lsdb.getSyncLogicHandler()
-                       .publishRoutingUpdate(Lsa::Type::ADJACENCY, 0));
+  BOOST_CHECK_NO_THROW(nlsr.m_lsdb.m_sync.publishRoutingUpdate(Lsa::Type::ADJACENCY, 0));
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-lsa-rule.cpp b/tests/test-lsa-rule.cpp
index 26c8e25..56b1f5c 100644
--- a/tests/test-lsa-rule.cpp
+++ b/tests/test-lsa-rule.cpp
@@ -120,7 +120,7 @@
   lsaDataName.append(std::to_string(Lsa::Type::NAME));
 
   // This would be the sequence number of its own NameLsa
-  lsaDataName.appendNumber(nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+  lsaDataName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 
   // Append version, segmentNo
   lsaDataName.appendNumber(1).appendNumber(1);
@@ -150,7 +150,7 @@
   lsaDataName.append(std::to_string(Lsa::Type::NAME));
 
   // This would be the sequence number of its own NameLsa
-  lsaDataName.appendNumber(nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+  lsaDataName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 
   // Append version, segmentNo
   lsaDataName.appendNumber(1).appendNumber(1);
diff --git a/tests/test-lsa-segment-storage.cpp b/tests/test-lsa-segment-storage.cpp
index 7ebd900..ac2671f 100644
--- a/tests/test-lsa-segment-storage.cpp
+++ b/tests/test-lsa-segment-storage.cpp
@@ -23,7 +23,6 @@
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "lsa-segment-storage.hpp"
 #include "test-common.hpp"
 #include "nlsr.hpp"
 #include "name-prefix-list.hpp"
@@ -38,38 +37,43 @@
 {
 public:
   LsaSegmentStorageFixture()
-    : face(m_ioService, m_keyChain)
+    : face(m_ioService, m_keyChain, {true, true})
     , conf(face)
+    , confProcessor(conf)
     , nlsr(face, m_keyChain, conf)
     , lsdb(nlsr.m_lsdb)
-    , lsaStorage(lsdb.m_lsaStorage)
+    , segmentPublisher(face, m_keyChain)
+    , numValidationSignal(0)
+    , afterSegmentValidatedConnection(lsdb.afterSegmentValidatedSignal.connect(
+                                      [this] (const ndn::Data& data) { ++numValidationSignal; }))
   {
+    std::string config = R"CONF(
+                            trust-anchor
+                              {
+                                type any
+                              }
+                          )CONF";
+    conf.m_validator.load(config, "config-file-from-string");
+
+    nlsr.initialize();
+
+    this->advanceClocks(ndn::time::milliseconds(10));
+
+    face.sentInterests.clear();
   }
 
-  std::string
-  makeLsaContent()
+  void
+  makeLsaContent(const ndn::Name& interestName, int numNames = 1000)
   {
-    ndn::Name s1{"name1"};
-    ndn::Name s2{"name2"};
-    NamePrefixList npl1{s1, s2};
+    NamePrefixList npl1;
+    for (int i = 0; i < numNames; ++i) {
+      npl1.insert("name1-" + std::to_string(i));
+    }
     NameLsa nameLsa("/ndn/other-site/%C1.Router/other-router", 12,
                     ndn::time::system_clock::now() + ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT), npl1);
-    return nameLsa.serialize();
-  }
-
-  shared_ptr<ndn::Data>
-  makeLsaSegment(const ndn::Name& baseName, uint64_t segmentNo, bool isFinal)
-  {
-    ndn::Name lsaDataName(baseName);
-    lsaDataName.appendSegment(segmentNo);
-    auto lsaSegment = make_shared<ndn::Data>(ndn::Name(lsaDataName));
-    std::string content = makeLsaContent();
-    lsaSegment->setContent(reinterpret_cast<const uint8_t*>(content.c_str()), content.length());
-    if (isFinal) {
-      lsaSegment->setFinalBlock(lsaSegment->getName()[-1]);
-    }
-
-    return signData(lsaSegment);
+    segmentPublisher.publish(interestName, interestName,
+                             ndn::encoding::makeStringBlock(ndn::tlv::Content, nameLsa.serialize()),
+                             ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT));
   }
 
   void
@@ -90,9 +94,13 @@
 public:
   ndn::util::DummyClientFace face;
   ConfParameter conf;
+  DummyConfFileProcessor confProcessor;
   Nlsr nlsr;
   Lsdb& lsdb;
-  LsaSegmentStorage& lsaStorage;
+  psync::SegmentPublisher segmentPublisher;
+
+  int numValidationSignal;
+  ndn::util::signal::ScopedConnection afterSegmentValidatedConnection;
 };
 
 BOOST_FIXTURE_TEST_SUITE(TestLsaSegmentStorage, LsaSegmentStorageFixture)
@@ -102,85 +110,39 @@
   ndn::Name lsaInterestName("/ndn/NLSR/LSA/other-site/%C1.Router/other-router/NAME");
   lsaInterestName.appendNumber(12);
 
-  ndn::Name lsaDataName(lsaInterestName);
-  lsaDataName.appendVersion();
+  lsdb.expressInterest(lsaInterestName, 0);
+  advanceClocks(ndn::time::milliseconds(10));
 
-  for (uint64_t segmentNo = 0; segmentNo < 4; ++segmentNo) {
-    auto lsaData = makeLsaSegment(lsaDataName, segmentNo, segmentNo == 4);
-    lsaStorage.afterFetcherSignalEmitted(*lsaData);
+  makeLsaContent(lsaInterestName);
+  advanceClocks(ndn::time::milliseconds(10));
+
+  for (const auto& interest : face.sentInterests) {
+    segmentPublisher.replyFromStore(interest.getName());
+    advanceClocks(ndn::time::milliseconds(10));
   }
 
-  // receive interest for other-router's LSA that is stored in this router's storage
-  for (uint64_t segmentNo = 0; segmentNo < 4; ++segmentNo) {
-    receiveLsaInterest(lsaInterestName, segmentNo, segmentNo == 0);
-  }
+  // 3 data segments should be in the storage
+  BOOST_CHECK_EQUAL(lsdb.m_lsaStorage.size(), 3);
+  BOOST_CHECK_EQUAL(numValidationSignal, 3);
+  numValidationSignal = 0;
+  face.sentInterests.clear();
 
-  // 4 data segments should be sent in response to 4 interests
-  BOOST_CHECK_EQUAL(face.sentData.size(), 4);
-}
+  // Remove older LSA from storage upon receiving that of higher sequence
+  ndn::Name lsaInterestName2("/ndn/NLSR/LSA/other-site/%C1.Router/other-router/NAME");
+  lsaInterestName2.appendNumber(13);
+  lsdb.expressInterest(lsaInterestName2, 0);
+  advanceClocks(ndn::time::milliseconds(10));
 
-BOOST_AUTO_TEST_CASE(DeleteOldLsa)
-{
-  ndn::Name lsaDataName("/ndn/NLSR/LSA/other-site/%C1.Router/other-router/NAME");
-  uint64_t segmentNo = 0;
+  makeLsaContent(lsaInterestName2, 1);
+  advanceClocks(ndn::time::milliseconds(10));
+  // Should have cleared all the three segments for the previous interest w/ seq 12
+  // And add one segment for this sequence 13
+  BOOST_CHECK_EQUAL(lsdb.m_lsaStorage.size(), 1);
+  BOOST_CHECK_EQUAL(numValidationSignal, 1);
 
-  uint64_t oldSeqNo = 12;
-  ndn::Name oldLsaDataName(lsaDataName);
-  oldLsaDataName.appendNumber(oldSeqNo);
-  oldLsaDataName.appendVersion();
-
-  auto oldLsaData = makeLsaSegment(oldLsaDataName, segmentNo, true);
-  lsaStorage.afterFetcherSignalEmitted(*oldLsaData);
-  advanceClocks(ndn::time::milliseconds(1), 10);
-
-  uint64_t newSeqNo = 13;
-  ndn::Name newLsaDataName(lsaDataName);
-  newLsaDataName.appendNumber(newSeqNo);
-  newLsaDataName.appendVersion();
-
-  auto newLsaData = makeLsaSegment(newLsaDataName, segmentNo, true);
-  lsaStorage.afterFetcherSignalEmitted(*newLsaData);
-  advanceClocks(ndn::time::milliseconds(1), 10);
-
-  ndn::Name lsaInterestName(lsaDataName);
-
-  ndn::Name oldLsaInterestName(lsaInterestName);
-  oldLsaInterestName.appendNumber(oldSeqNo);
-  receiveLsaInterest(oldLsaInterestName, segmentNo, true);
-
-  advanceClocks(ndn::time::milliseconds(1), 10);
-
-  BOOST_CHECK_EQUAL(face.sentData.size(), 0);
-
-  ndn::Name newLsaInterestName(lsaInterestName);
-  newLsaInterestName.appendNumber(newSeqNo);
-  receiveLsaInterest(newLsaInterestName, segmentNo, true);
-
-  advanceClocks(ndn::time::milliseconds(1), 10);
-
-  BOOST_CHECK_EQUAL(face.sentData.size(), 1);
-}
-
-BOOST_AUTO_TEST_CASE(ScheduledDeletion)
-{
-  ndn::Name lsaInterestName("/ndn/NLSR/LSA/other-site/%C1.Router/other-router/NAME");
-  lsaInterestName.appendNumber(12);
-
-  ndn::Name lsaDataName(lsaInterestName);
-  lsaDataName.appendVersion();
-
-  auto lsaData = makeLsaSegment(lsaDataName, 0, true);
-  lsaStorage.afterFetcherSignalEmitted(*lsaData);
-
-  BOOST_CHECK(lsaStorage.getLsaSegment(ndn::Interest(lsaInterestName)) != nullptr);
-
-  // Make sure it was not deleted earlier somehow
-  advanceClocks(ndn::time::seconds(100), 10);
-  BOOST_CHECK(lsaStorage.getLsaSegment(ndn::Interest(lsaInterestName)) != nullptr);
-
-  advanceClocks(ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT), 10);
-
-  BOOST_CHECK(lsaStorage.getLsaSegment(ndn::Interest(lsaInterestName)) == nullptr);
+  // Scheduled removal of LSA
+  advanceClocks(ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT));
+  BOOST_CHECK_EQUAL(lsdb.m_lsaStorage.size(), 0);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestLsaSegmentStorage
diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp
index 17801d6..229c004 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.cpp
@@ -129,7 +129,7 @@
   const Lsdb& lsdb = nlsr2.m_lsdb;
   const RoutingTable& rt = nlsr2.m_routingTable;
 
-  BOOST_CHECK_EQUAL(lsdb.getAdjLsaBuildInterval(), ndn::time::seconds(3));
+  BOOST_CHECK_EQUAL(lsdb.m_adjLsaBuildInterval, ndn::time::seconds(3));
   BOOST_CHECK_EQUAL(conf.getFirstHelloInterval(), 6);
   BOOST_CHECK_EQUAL(rt.getRoutingCalcInterval(), ndn::time::seconds(9));
 }
@@ -288,7 +288,7 @@
   BOOST_REQUIRE(lsa != nullptr);
 
   uint32_t lastAdjLsaSeqNo = lsa->getLsSeqNo();
-  nlsr.m_lsdb.getSequencingManager().setAdjLsaSeq(lastAdjLsaSeqNo);
+  nlsr.m_lsdb.m_sequencingManager.setAdjLsaSeq(lastAdjLsaSeqNo);
 
   this->advanceClocks(1500_ms, 10);
 
diff --git a/tests/update/test-nfd-rib-command-processor.cpp b/tests/update/test-nfd-rib-command-processor.cpp
index 8aa8cdf..17485da 100644
--- a/tests/update/test-nfd-rib-command-processor.cpp
+++ b/tests/update/test-nfd-rib-command-processor.cpp
@@ -49,7 +49,7 @@
     this->advanceClocks(ndn::time::milliseconds(10), 10);
     face.sentInterests.clear();
 
-    nameLsaSeqNoBeforeInterest = nlsr.m_lsdb.getSequencingManager().getNameLsaSeq();
+    nameLsaSeqNoBeforeInterest = nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq();
   }
 
   void
@@ -67,7 +67,7 @@
     lsaInterestName.append(conf.getSiteName());
     lsaInterestName.append(conf.getRouterName());
     lsaInterestName.append(std::to_string(Lsa::Type::NAME));
-    lsaInterestName.appendNumber(nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+    lsaInterestName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 
     face.receive(ndn::Interest(lsaInterestName).setCanBePrefix(true));
     this->advanceClocks(ndn::time::milliseconds(10), 10);
@@ -144,7 +144,7 @@
   }
   BOOST_CHECK_EQUAL((*itr), prefixName);
   BOOST_CHECK(wasRoutingUpdatePublished());
-  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_CASE(onReceiveInterestUnregisterCommand)
@@ -160,7 +160,7 @@
 
   BOOST_CHECK_EQUAL(namePrefixes.getNames().size(), 0);
   BOOST_CHECK(wasRoutingUpdatePublished());
-  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_CASE(onReceiveInterestInvalidPrefix)
@@ -176,7 +176,7 @@
 
   // Cannot use routingUpdatePublish test now since in
   // initialize nlsr calls buildOwnNameLsa which publishes the routing update
-  BOOST_CHECK(nameLsaSeqNoBeforeInterest == nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest == nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/update/test-prefix-update-processor.cpp b/tests/update/test-prefix-update-processor.cpp
index 3cdb8c4..5a6cbde 100644
--- a/tests/update/test-prefix-update-processor.cpp
+++ b/tests/update/test-prefix-update-processor.cpp
@@ -100,7 +100,7 @@
     lsaInterestName.append(conf.getRouterName());
     lsaInterestName.append(std::to_string(Lsa::Type::NAME));
 
-    lsaInterestName.appendNumber(nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+    lsaInterestName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 
     auto lsaInterest = std::make_shared<Interest>(lsaInterestName);
     lsaInterest->setCanBePrefix(true);
@@ -145,7 +145,7 @@
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
-  uint64_t nameLsaSeqNoBeforeInterest = nlsr.m_lsdb.getSequencingManager().getNameLsaSeq();
+  uint64_t nameLsaSeqNoBeforeInterest = nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq();
 
   ndn::nfd::ControlParameters parameters;
   parameters.setName("/prefix/to/advertise/");
@@ -177,10 +177,10 @@
   BOOST_CHECK_EQUAL(namePrefixList.getNames().front(), parameters.getName());
 
   BOOST_CHECK(wasRoutingUpdatePublished());
-  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 
   face.sentData.clear();
-  nameLsaSeqNoBeforeInterest = nlsr.m_lsdb.getSequencingManager().getNameLsaSeq();
+  nameLsaSeqNoBeforeInterest = nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq();
 
   //Withdraw
   ndn::Name withdrawCommand("/localhost/nlsr/prefix-update/withdraw");
@@ -196,7 +196,7 @@
   BOOST_CHECK_EQUAL(namePrefixList.size(), 0);
 
   BOOST_CHECK(wasRoutingUpdatePublished());
-  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.getSequencingManager().getNameLsaSeq());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_SUITE_END()
