diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 09d5c27..1413b39 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -26,7 +26,6 @@
 #include "logger.hpp"
 #include "lsa.hpp"
 #include "lsdb.hpp"
-#include "sequencing-manager.hpp"
 #include "utility/name-helper.hpp"
 
 namespace nlsr {
@@ -36,85 +35,8 @@
 using namespace ndn;
 using namespace std;
 
-class SyncUpdate
-{
-public:
-  class Error : public std::runtime_error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : std::runtime_error(what)
-    {
-    }
-  };
-
-public:
-  SyncUpdate(const ndn::Name& name, uint64_t seqNo)
-    : m_name(name)
-    , m_seqManager(seqNo)
-  {
-  }
-
-  const ndn::Name&
-  getName() const
-  {
-    return m_name;
-  }
-
-  const ndn::Name
-  getOriginRouter() const
-  {
-    int32_t nlsrPosition = util::getNameComponentPosition(m_name, NLSR_COMPONENT);
-    int32_t lsaPosition = util::getNameComponentPosition(m_name, LSA_COMPONENT);
-
-    if (nlsrPosition < 0 || lsaPosition < 0) {
-      BOOST_THROW_EXCEPTION(Error("Cannot parse update name because expected components are missing"));
-    }
-
-    ndn::Name networkName = m_name.getSubName(1, nlsrPosition-1);
-    ndn::Name routerName = m_name.getSubName(lsaPosition + 1);
-
-    ndn::Name originRouter = networkName;
-    originRouter.append(routerName);
-
-    return originRouter;
-  }
-
-  uint64_t
-  getNameLsaSeqNo() const
-  {
-    return m_seqManager.getNameLsaSeq();
-  }
-
-  uint64_t
-  getAdjLsaSeqNo() const
-  {
-    return m_seqManager.getAdjLsaSeq();
-  }
-
-  uint64_t
-  getCorLsaSeqNo() const
-  {
-    return m_seqManager.getCorLsaSeq();
-  }
-
-  const SequencingManager&
-  getSequencingManager() const
-  {
-    return m_seqManager;
-  }
-
-private:
-  const ndn::Name m_name;
-  SequencingManager m_seqManager;
-
-  static const std::string NLSR_COMPONENT;
-  static const std::string LSA_COMPONENT;
-};
-
-const std::string SyncUpdate::NLSR_COMPONENT = "NLSR";
-const std::string SyncUpdate::LSA_COMPONENT = "LSA";
+const std::string NLSR_COMPONENT = "NLSR";
+const std::string LSA_COMPONENT = "LSA";
 
 template<class T>
 class NullDeleter
@@ -127,13 +49,10 @@
 };
 
 SyncLogicHandler::SyncLogicHandler(ndn::Face& face,
-                                   Lsdb& lsdb, ConfParameter& conf,
-                                   SequencingManager& seqManager)
-  : m_validator(new ndn::ValidatorNull())
-  , m_syncFace(face)
+                                   Lsdb& lsdb, ConfParameter& conf)
+  : m_syncFace(face)
   , m_lsdb(lsdb)
   , m_confParam(conf)
-  , m_sequencingManager(seqManager)
 {
 }
 
@@ -156,8 +75,16 @@
   // of the object
   std::shared_ptr<ndn::Face> facePtr(&m_syncFace, NullDeleter<ndn::Face>());
 
-  m_syncSocket = std::make_shared<chronosync::Socket>(m_syncPrefix, m_updatePrefix, *facePtr,
+
+  m_syncSocket = std::make_shared<chronosync::Socket>(m_syncPrefix, m_nameLsaUserPrefix, *facePtr,
                                                       bind(&SyncLogicHandler::onNsyncUpdate, this, _1));
+
+  if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
+    m_syncSocket->addSyncNode(m_adjLsaUserPrefix);
+  }
+  else {
+    m_syncSocket->addSyncNode(m_coorLsaUserPrefix);
+  }
 }
 
 void
@@ -166,75 +93,64 @@
   _LOG_DEBUG("Received Nsync update event");
 
   for (size_t i = 0; i < v.size(); i++){
-    _LOG_DEBUG("Update Name: " << v[i].session.getPrefix(-1).toUri() << " Seq no: " << v[i].high);
+    ndn::Name updateName = v[i].session.getPrefix(-1);
 
-    SyncUpdate update(v[i].session.getPrefix(-1), v[i].high);
+    _LOG_DEBUG("Update Name: " << updateName << " Seq no: " << v[i].high);
 
-    processUpdateFromSync(update);
+    int32_t nlsrPosition = util::getNameComponentPosition(updateName, nlsr::NLSR_COMPONENT);
+    int32_t lsaPosition = util::getNameComponentPosition(updateName, nlsr::LSA_COMPONENT);
+
+    if (nlsrPosition < 0 || lsaPosition < 0) {
+      _LOG_WARN("Received malformed sync update");
+      return;
+    }
+
+    ndn::Name networkName = updateName.getSubName(1, nlsrPosition-1);
+    ndn::Name routerName = updateName.getSubName(lsaPosition + 1).getPrefix(-1);
+
+    ndn::Name originRouter = networkName;
+    originRouter.append(routerName);
+
+    processUpdateFromSync(originRouter, updateName, v[i].high);
   }
 }
 
 void
-SyncLogicHandler::onNsyncRemoval(const string& prefix)
+SyncLogicHandler::processUpdateFromSync(const ndn::Name& originRouter,
+                                        const ndn::Name& updateName, const uint64_t& seqNo)
 {
-  _LOG_DEBUG("Received Nsync removal event");
-}
-
-void
-SyncLogicHandler::processUpdateFromSync(const SyncUpdate& update)
-{
-  ndn::Name originRouter;
-
-  try {
-    originRouter = update.getOriginRouter();
-  }
-  catch (const std::exception& e) {
-    _LOG_WARN("Received malformed sync update");
-    return;
-  }
+  _LOG_DEBUG("Origin Router of update: " << originRouter);
 
   // A router should not try to fetch its own LSA
   if (originRouter != m_confParam.getRouterPrefix()) {
 
-    update.getSequencingManager().writeLog();
+    std::string lsaType = updateName.get(updateName.size()-1).toUri();
 
-    if (isLsaNew(originRouter, NameLsa::TYPE_STRING, update.getNameLsaSeqNo())) {
-        _LOG_DEBUG("Received sync update with higher Name LSA sequence number than entry in LSDB");
+    _LOG_DEBUG("Received sync update with higher " << lsaType
+               << " sequence number than entry in LSDB");
 
-        expressInterestForLsa(update, NameLsa::TYPE_STRING, update.getNameLsaSeqNo());
+    if (isLsaNew(originRouter, lsaType, seqNo)) {
+      if (lsaType == AdjLsa::TYPE_STRING && seqNo != 0 &&
+          m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
+        _LOG_ERROR("Got an update for adjacency LSA when hyperbolic routing"
+                   << " is enabled. Not going to fetch.");
+        return;
       }
 
-      if (isLsaNew(originRouter, AdjLsa::TYPE_STRING, update.getAdjLsaSeqNo())) {
-        _LOG_DEBUG("Received sync update with higher Adj LSA sequence number than entry in LSDB");
-        if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
-          if (update.getAdjLsaSeqNo() != 0) {
-            _LOG_ERROR("Tried to fetch an adjacency LSA when hyperbolic routing"
-                       << " is enabled.");
-          }
-        }
-        else {
-          expressInterestForLsa(update, AdjLsa::TYPE_STRING, update.getAdjLsaSeqNo());
-        }
+      if (lsaType == CoordinateLsa::TYPE_STRING && seqNo != 0 &&
+          m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
+        _LOG_ERROR("Got an update for coordinate LSA when link-state"
+                   << " is enabled. Not going to fetch.");
+        return;
       }
-
-      if (isLsaNew(originRouter, CoordinateLsa::TYPE_STRING, update.getCorLsaSeqNo())) {
-        _LOG_DEBUG("Received sync update with higher Cor LSA sequence number than entry in LSDB");
-        if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
-          if (update.getCorLsaSeqNo() != 0) {
-            _LOG_ERROR("Tried to fetch a coordinate LSA when link-state"
-                       << " is enabled.");
-          }
-        }
-        else {
-          expressInterestForLsa(update, CoordinateLsa::TYPE_STRING, update.getCorLsaSeqNo());
-        }
-      }
+      expressInterestForLsa(updateName, seqNo);
+    }
   }
 }
 
 bool
 SyncLogicHandler::isLsaNew(const ndn::Name& originRouter, const std::string& lsaType,
-                           uint64_t seqNo)
+                           const uint64_t& seqNo)
 {
   ndn::Name lsaKey = originRouter;
   lsaKey.append(lsaType);
@@ -256,18 +172,17 @@
 }
 
 void
-SyncLogicHandler::expressInterestForLsa(const SyncUpdate& update, std::string lsaType,
-                                        uint64_t seqNo)
+SyncLogicHandler::expressInterestForLsa(const ndn::Name& updateName,
+                                        const uint64_t& seqNo)
 {
-  ndn::Name interest(update.getName());
-  interest.append(lsaType);
+  ndn::Name interest(updateName);
   interest.appendNumber(seqNo);
 
   m_lsdb.expressInterest(interest, 0);
 }
 
 void
-SyncLogicHandler::publishRoutingUpdate()
+SyncLogicHandler::publishRoutingUpdate(const ndn::Name& type, const uint64_t& seqNo)
 {
   if (m_syncSocket == nullptr) {
     _LOG_FATAL("Cannot publish routing update; SyncSocket does not exist");
@@ -275,17 +190,32 @@
     BOOST_THROW_EXCEPTION(SyncLogicHandler::Error("Cannot publish routing update; SyncSocket does not exist"));
   }
 
-  m_sequencingManager.writeSeqNoToFile();
-
-  publishSyncUpdate(m_updatePrefix, m_sequencingManager.getCombinedSeqNo());
+  if (type == NameLsa::TYPE_STRING) {
+    publishSyncUpdate(m_nameLsaUserPrefix, seqNo);
+  }
+  else if (type == AdjLsa::TYPE_STRING) {
+    publishSyncUpdate(m_adjLsaUserPrefix, seqNo);
+  }
+  else {
+    publishSyncUpdate(m_coorLsaUserPrefix, seqNo);
+  }
 }
 
 void
 SyncLogicHandler::buildUpdatePrefix()
 {
-  m_updatePrefix = m_confParam.getLsaPrefix();
-  m_updatePrefix.append(m_confParam.getSiteName());
-  m_updatePrefix.append(m_confParam.getRouterName());
+  ndn::Name updatePrefix = m_confParam.getLsaPrefix();
+  updatePrefix.append(m_confParam.getSiteName());
+  updatePrefix.append(m_confParam.getRouterName());
+
+  m_nameLsaUserPrefix = updatePrefix;
+  m_nameLsaUserPrefix.append(NameLsa::TYPE_STRING);
+
+  m_adjLsaUserPrefix = updatePrefix;
+  m_adjLsaUserPrefix.append(AdjLsa::TYPE_STRING);
+
+  m_coorLsaUserPrefix = updatePrefix;
+  m_coorLsaUserPrefix.append(CoordinateLsa::TYPE_STRING);
 }
 
 void
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index c8e143e..2b7dd94 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -23,7 +23,6 @@
 #define NLSR_SYNC_LOGIC_HANDLER_HPP
 
 #include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/validator-null.hpp>
 #include <ChronoSync/socket.hpp>
 
 #include <iostream>
@@ -39,8 +38,6 @@
 
 class ConfParameter;
 class Lsdb;
-class SequencingManager;
-class SyncUpdate;
 
 class SyncLogicHandler
 {
@@ -55,21 +52,29 @@
     }
   };
 
-  SyncLogicHandler(ndn::Face& face, Lsdb& lsdb, ConfParameter& conf, SequencingManager& seqManager);
+  SyncLogicHandler(ndn::Face& face, Lsdb& lsdb, ConfParameter& conf);
 
-  /*! \brief Simple wrapper function to handle updates from Sync.
+  /*! \brief Receive and parse update from Sync
+
+    Parses the router name the update came from and passes it to processUpdateFromSync
 
     \param v The information that Sync has acquired.
    */
   void
   onNsyncUpdate(const std::vector<chronosync::MissingDataInfo>& v);
 
-  void
-  onNsyncRemoval(const std::string& prefix);
+  /*! \brief Wrapper function to call publishSyncUpdate with correct LSA type
 
+    \param type The LSA type constant
+    \param seqNo The latest seqNo known to lsdb
+   */
   void
-  publishRoutingUpdate();
+  publishRoutingUpdate(const ndn::Name& type, const uint64_t& seqNo);
 
+  /*! \brief Creates ChronoSync socket and register additional sync nodes (user prefixes)
+
+    \param syncPrefix /localhop/NLSR/sync
+   */
   void
   createSyncSocket(const ndn::Name& syncPrefix);
 
@@ -78,19 +83,20 @@
   buildUpdatePrefix();
 
   void
-  processUpdateFromSync(const SyncUpdate& updateName);
+  processUpdateFromSync(const ndn::Name& originRouter,
+                        const ndn::Name& updateName, const uint64_t& seqNo);
 
   bool
-  isLsaNew(const ndn::Name& originRouter, const std::string& lsaType, uint64_t seqNo);
+  isLsaNew(const ndn::Name& originRouter, const std::string& lsaType,
+           const uint64_t& seqNo);
 
   void
-  expressInterestForLsa(const SyncUpdate& updateName, std::string lsaType, uint64_t seqNo);
+  expressInterestForLsa(const ndn::Name& updateName, const uint64_t& seqNo);
 
   void
   publishSyncUpdate(const ndn::Name& updatePrefix, uint64_t seqNo);
 
 private:
-  std::shared_ptr<ndn::ValidatorNull> m_validator;
   ndn::Face& m_syncFace;
   std::shared_ptr<chronosync::Socket> m_syncSocket;
   ndn::Name m_syncPrefix;
@@ -98,10 +104,11 @@
 private:
   Lsdb& m_lsdb;
   ConfParameter& m_confParam;
-  const SequencingManager& m_sequencingManager;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  ndn::Name m_updatePrefix;
+  ndn::Name m_nameLsaUserPrefix;
+  ndn::Name m_adjLsaUserPrefix;
+  ndn::Name m_coorLsaUserPrefix;
 
 private:
   static const std::string NLSR_COMPONENT;
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 8468947..61a23f5 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -63,12 +63,13 @@
 const ndn::time::seconds Lsdb::GRACE_PERIOD = ndn::time::seconds(10);
 const steady_clock::TimePoint Lsdb::DEFAULT_LSA_RETRIEVAL_DEADLINE = steady_clock::TimePoint::min();
 
-Lsdb::Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler, SyncLogicHandler& sync)
+Lsdb::Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler)
   : m_nlsr(nlsr)
   , m_scheduler(scheduler)
-  , m_sync(sync)
+  , m_sync(m_nlsr.getNlsrFace(), *this, m_nlsr.getConfParameter())
   , m_lsaRefreshTime(0)
   , m_adjLsaBuildInterval(ADJ_LSA_BUILD_INTERVAL_DEFAULT)
+  , m_sequencingManager()
 {
 }
 
@@ -150,10 +151,14 @@
 Lsdb::buildAndInstallOwnNameLsa()
 {
   NameLsa nameLsa(m_nlsr.getConfParameter().getRouterPrefix(),
-                  m_nlsr.getSequencingManager().getNameLsaSeq() + 1,
+                  m_sequencingManager.getNameLsaSeq() + 1,
                   getLsaExpirationTimePoint(),
                   m_nlsr.getNamePrefixList());
-  m_nlsr.getSequencingManager().increaseNameLsaSeq();
+  m_sequencingManager.increaseNameLsaSeq();
+
+  m_sequencingManager.writeSeqNoToFile();
+  m_sync.publishRoutingUpdate(NameLsa::TYPE_STRING, m_sequencingManager.getNameLsaSeq());
+
   return installNameLsa(nameLsa);
 }
 
@@ -378,15 +383,16 @@
 Lsdb::buildAndInstallOwnCoordinateLsa()
 {
   CoordinateLsa corLsa(m_nlsr.getConfParameter().getRouterPrefix(),
-                       m_nlsr.getSequencingManager().getCorLsaSeq() + 1,
+                       m_sequencingManager.getCorLsaSeq() + 1,
                        getLsaExpirationTimePoint(),
                        m_nlsr.getConfParameter().getCorR(),
                        m_nlsr.getConfParameter().getCorTheta());
 
   // Sync coordinate LSAs if using HR or HR dry run.
   if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
-    m_nlsr.getSequencingManager().increaseCorLsaSeq();
-    m_sync.publishRoutingUpdate();
+    m_sequencingManager.increaseCorLsaSeq();
+    m_sequencingManager.writeSeqNoToFile();
+    m_sync.publishRoutingUpdate(CoordinateLsa::TYPE_STRING, m_sequencingManager.getCorLsaSeq());
   }
 
   installCoordinateLsa(corLsa);
@@ -751,15 +757,16 @@
 Lsdb::buildAndInstallOwnAdjLsa()
 {
   AdjLsa adjLsa(m_nlsr.getConfParameter().getRouterPrefix(),
-                m_nlsr.getSequencingManager().getAdjLsaSeq() + 1,
+                m_sequencingManager.getAdjLsaSeq() + 1,
                 getLsaExpirationTimePoint(),
                 m_nlsr.getAdjacencyList().getNumOfActiveNeighbor(),
                 m_nlsr.getAdjacencyList());
 
   //Sync adjacency LSAs if link-state or dry-run HR is enabled.
   if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_ON) {
-    m_nlsr.getSequencingManager().increaseAdjLsaSeq();
-    m_sync.publishRoutingUpdate();
+    m_sequencingManager.increaseAdjLsaSeq();
+    m_sequencingManager.writeSeqNoToFile();
+    m_sync.publishRoutingUpdate(AdjLsa::TYPE_STRING, m_sequencingManager.getAdjLsaSeq());
   }
 
   return installAdjLsa(adjLsa);
@@ -834,7 +841,7 @@
         _LOG_DEBUG("Deleting Name Lsa");
         chkNameLsa->writeLog();
         chkNameLsa->setLsSeqNo(chkNameLsa->getLsSeqNo() + 1);
-        m_nlsr.getSequencingManager().setNameLsaSeq(chkNameLsa->getLsSeqNo());
+        m_sequencingManager.setNameLsaSeq(chkNameLsa->getLsSeqNo());
         chkNameLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
         _LOG_DEBUG("Adding Name Lsa");
         chkNameLsa->writeLog();
@@ -842,7 +849,8 @@
         chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(chkNameLsa->getKey(),
                                                                  chkNameLsa->getLsSeqNo(),
                                                                  m_lsaRefreshTime));
-        m_sync.publishRoutingUpdate();
+        m_sequencingManager.writeSeqNoToFile();
+        m_sync.publishRoutingUpdate(NameLsa::TYPE_STRING, m_sequencingManager.getNameLsaSeq());
       }
       // Since we cannot refresh other router's LSAs, our only choice is to expire.
       else {
@@ -877,7 +885,7 @@
         _LOG_DEBUG("Deleting Adj Lsa");
         chkAdjLsa->writeLog();
         chkAdjLsa->setLsSeqNo(chkAdjLsa->getLsSeqNo() + 1);
-        m_nlsr.getSequencingManager().setAdjLsaSeq(chkAdjLsa->getLsSeqNo());
+        m_sequencingManager.setAdjLsaSeq(chkAdjLsa->getLsSeqNo());
         chkAdjLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
         _LOG_DEBUG("Adding Adj Lsa");
         chkAdjLsa->writeLog();
@@ -885,7 +893,8 @@
         chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(chkAdjLsa->getKey(),
                                                                chkAdjLsa->getLsSeqNo(),
                                                                m_lsaRefreshTime));
-        m_sync.publishRoutingUpdate();
+        m_sequencingManager.writeSeqNoToFile();
+        m_sync.publishRoutingUpdate(AdjLsa::TYPE_STRING, m_sequencingManager.getAdjLsaSeq());
       }
       // An LSA from another router is expiring
       else {
@@ -924,7 +933,7 @@
         chkCorLsa->writeLog();
         chkCorLsa->setLsSeqNo(chkCorLsa->getLsSeqNo() + 1);
         if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
-          m_nlsr.getSequencingManager().setCorLsaSeq(chkCorLsa->getLsSeqNo());
+          m_sequencingManager.setCorLsaSeq(chkCorLsa->getLsSeqNo());
         }
 
         chkCorLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
@@ -937,7 +946,8 @@
                                         m_lsaRefreshTime));
         // Only sync coordinate LSAs if link-state routing is disabled
         if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
-          m_sync.publishRoutingUpdate();
+          m_sequencingManager.writeSeqNoToFile();
+          m_sync.publishRoutingUpdate(CoordinateLsa::TYPE_STRING, m_sequencingManager.getCorLsaSeq());
         }
       }
       // We can't refresh other router's LSAs, so we remove it.
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index a2d42cd..1ac25f2 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -30,19 +30,26 @@
 
 #include "conf-parameter.hpp"
 #include "lsa.hpp"
+#include "sequencing-manager.hpp"
 #include "test-access-control.hpp"
+#include "communication/sync-logic-handler.hpp"
 
 namespace nlsr {
 
 using namespace ndn::time;
 
 class Nlsr;
-class SyncLogicHandler;
 
 class Lsdb
 {
 public:
-  Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler, SyncLogicHandler& sync);
+  Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler);
+
+  SyncLogicHandler&
+  getSyncLogicHandler()
+  {
+    return m_sync;
+  }
 
   bool
   doesLsaExist(const ndn::Name& key, const std::string& lsType);
@@ -181,6 +188,12 @@
     return m_adjLsaBuildInterval;
   }
 
+  SequencingManager&
+  getSequencingManager()
+  {
+    return m_sequencingManager;
+  }
+
   void
   writeAdjLsdbLog();
 
@@ -364,7 +377,7 @@
 private:
   Nlsr& m_nlsr;
   ndn::Scheduler& m_scheduler;
-  SyncLogicHandler& m_sync;
+  SyncLogicHandler m_sync;
 
   std::list<NameLsa> m_nameLsdb;
   std::list<AdjLsa> m_adjLsdb;
@@ -383,6 +396,8 @@
   static const steady_clock::TimePoint DEFAULT_LSA_RETRIEVAL_DEADLINE;
 
   ndn::time::seconds m_adjLsaBuildInterval;
+
+  SequencingManager m_sequencingManager;
 };
 
 } // namespace nlsr
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 8a88c1f..f0c4305 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -46,10 +46,9 @@
   , m_confParam()
   , m_adjacencyList()
   , m_namePrefixList()
-  , m_sequencingManager()
   , m_isDaemonProcess(false)
   , m_configFileName("nlsr.conf")
-  , m_nlsrLsdb(*this, scheduler, m_syncLogicHandler)
+  , m_nlsrLsdb(*this, scheduler)
   , m_adjBuildCount(0)
   , m_isBuildAdjLsaSheduled(false)
   , m_isRouteCalculationScheduled(false)
@@ -57,7 +56,6 @@
   , m_routingTable(scheduler)
   , m_fib(m_nlsrFace, scheduler, m_adjacencyList, m_confParam, m_keyChain)
   , m_namePrefixTable(*this)
-  , m_syncLogicHandler(m_nlsrFace, m_nlsrLsdb, m_confParam, m_sequencingManager)
   , m_lsdbDatasetHandler(m_nlsrLsdb,
                          m_nlsrFace,
                          m_keyChain)
@@ -67,7 +65,6 @@
   , m_prefixUpdateProcessor(m_nlsrFace,
                             m_namePrefixList,
                             m_nlsrLsdb,
-                            m_syncLogicHandler,
                             DEFAULT_BROADCAST_PREFIX,
                             m_keyChain,
                             m_certificateCache,
@@ -75,8 +72,7 @@
   , m_dispatcher(m_nlsrFace, m_keyChain, m_signingInfo)
   , m_nfdRibCommandProcessor(m_dispatcher,
                              m_namePrefixList,
-                             m_nlsrLsdb,
-                             m_syncLogicHandler)
+                             m_nlsrLsdb)
   , m_faceMonitor(m_nlsrFace)
   , m_firstHelloInterval(FIRST_HELLO_INTERVAL_DEFAULT)
 {
@@ -232,10 +228,11 @@
   m_nlsrLsdb.setLsaRefreshTime(ndn::time::seconds(m_confParam.getLsaRefreshTime()));
   m_nlsrLsdb.setThisRouterPrefix(m_confParam.getRouterPrefix().toUri());
   m_fib.setEntryRefreshTime(2 * m_confParam.getLsaRefreshTime());
-  m_sequencingManager.setSeqFileName(m_confParam.getSeqFileDir());
-  m_sequencingManager.initiateSeqNoFromFile(m_confParam.getHyperbolicState());
 
-  m_syncLogicHandler.createSyncSocket(m_confParam.getChronosyncPrefix());
+  m_nlsrLsdb.getSequencingManager().setSeqFileDirectory(m_confParam.getSeqFileDir());
+  m_nlsrLsdb.getSequencingManager().initiateSeqNoFromFile(m_confParam.getHyperbolicState());
+
+  m_nlsrLsdb.getSyncLogicHandler().createSyncSocket(m_confParam.getChronosyncPrefix());
 
   // Logging start
   m_confParam.writeLog();
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 574e53a..3df4fd1 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -40,10 +40,8 @@
 #include "hello-protocol.hpp"
 #include "lsdb.hpp"
 #include "name-prefix-list.hpp"
-#include "sequencing-manager.hpp"
 #include "test-access-control.hpp"
 #include "validator.hpp"
-#include "communication/sync-logic-handler.hpp"
 #include "publisher/lsdb-dataset-interest-handler.hpp"
 #include "route/fib.hpp"
 #include "route/name-prefix-table.hpp"
@@ -140,12 +138,6 @@
     return m_nlsrFace;
   }
 
-  SequencingManager&
-  getSequencingManager()
-  {
-    return m_sequencingManager;
-  }
-
   Lsdb&
   getLsdb()
   {
@@ -224,12 +216,6 @@
     m_isRouteCalculationScheduled = ircs;
   }
 
-  SyncLogicHandler&
-  getSyncLogicHandler()
-  {
-    return m_syncLogicHandler;
-  }
-
   LsdbDatasetInterestHandler&
   getLsdbDatasetHandler()
   {
@@ -408,7 +394,6 @@
   ConfParameter m_confParam;
   AdjacencyList m_adjacencyList;
   NamePrefixList m_namePrefixList;
-  SequencingManager m_sequencingManager;
   bool m_isDaemonProcess;
   std::string m_configFileName;
   Lsdb m_nlsrLsdb;
@@ -419,7 +404,6 @@
   RoutingTable m_routingTable;
   Fib m_fib;
   NamePrefixTable m_namePrefixTable;
-  SyncLogicHandler m_syncLogicHandler;
   LsdbDatasetInterestHandler m_lsdbDatasetHandler;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
diff --git a/src/sequencing-manager.cpp b/src/sequencing-manager.cpp
index 1c91700..6eaab5d 100644
--- a/src/sequencing-manager.cpp
+++ b/src/sequencing-manager.cpp
@@ -25,6 +25,7 @@
 #include <pwd.h>
 #include <cstdlib>
 #include <unistd.h>
+#include <boost/algorithm/string.hpp>
 
 #include "sequencing-manager.hpp"
 #include "logger.hpp"
@@ -36,28 +37,15 @@
 using namespace std;
 
 void
-SequencingManager::splitSequenceNo(uint64_t seqNo)
-{
-  m_combinedSeqNo = seqNo;
-  m_adjLsaSeq = (m_combinedSeqNo & 0xFFFFF);
-  m_corLsaSeq = ((m_combinedSeqNo >> 20) & 0xFFFFF);
-  m_nameLsaSeq = ((m_combinedSeqNo >> 40) & 0xFFFFFF);
-}
-
-void
-SequencingManager::combineSequenceNo()
-{
-  m_combinedSeqNo = 0;
-  m_combinedSeqNo = m_combinedSeqNo | m_adjLsaSeq;
-  m_combinedSeqNo = m_combinedSeqNo | (m_corLsaSeq << 20);
-  m_combinedSeqNo = m_combinedSeqNo | (m_nameLsaSeq << 40);
-}
-
-void
 SequencingManager::writeSeqNoToFile() const
 {
-  std::ofstream outputFile(m_seqFileNameWithPath.c_str(), ios::binary);
-  outputFile << m_combinedSeqNo;
+  writeLog();
+  std::ofstream outputFile(m_seqFileNameWithPath.c_str());
+  std::ostringstream os;
+  os << "NameLsaSeq " << std::to_string(m_nameLsaSeq) << "\n"
+     << "AdjLsaSeq "  << std::to_string(m_adjLsaSeq)  << "\n"
+     << "CorLsaSeq "  << std::to_string(m_corLsaSeq);
+  outputFile << os.str();
   outputFile.close();
 }
 
@@ -65,10 +53,40 @@
 SequencingManager::initiateSeqNoFromFile(int hypState)
 {
   _LOG_DEBUG("Seq File Name: " << m_seqFileNameWithPath);
-  std::ifstream inputFile(m_seqFileNameWithPath.c_str(), ios::binary);
+  std::ifstream inputFile(m_seqFileNameWithPath.c_str());
+
+  // Good checks that file is not (bad or eof or fail)
   if (inputFile.good()) {
-    inputFile >> m_combinedSeqNo;
-    splitSequenceNo(m_combinedSeqNo);
+    std::string lsaOrCombinedSeqNo;
+    uint64_t seqNo = 0;
+
+    // If file has a combined seq number, lsaOrCombinedSeqNo would hold it
+    // and seqNo will be zero everytime
+    inputFile >> lsaOrCombinedSeqNo >> seqNo;
+    m_nameLsaSeq = seqNo;
+
+    inputFile >> lsaOrCombinedSeqNo >> seqNo;
+    m_adjLsaSeq = seqNo;
+
+    inputFile >> lsaOrCombinedSeqNo >> seqNo;;
+    m_corLsaSeq = seqNo;
+
+    // File was in old format and had a combined sequence number
+    // if all of the seqNo should are still zero and
+    // lsaOrCombinedSeqNo != CorLsaSeq
+    if (m_nameLsaSeq == 0 && m_adjLsaSeq == 0 && m_corLsaSeq == 0 &&
+        lsaOrCombinedSeqNo != "CorLsaSeq") {
+      _LOG_DEBUG("Old file had combined sequence number: " << lsaOrCombinedSeqNo);
+      std::istringstream iss(lsaOrCombinedSeqNo);
+      iss >> seqNo;
+      m_adjLsaSeq = (seqNo & 0xFFFFF);
+      m_corLsaSeq = ((seqNo >> 20) & 0xFFFFF);
+      m_nameLsaSeq = ((seqNo >> 40) & 0xFFFFFF);
+    }
+
+    inputFile.close();
+
+    m_nameLsaSeq += 10;
 
     // Increment the adjacency LSA seq. no. if link-state or dry HR is enabled
     if (hypState != HYPERBOLIC_STATE_ON) {
@@ -82,43 +100,32 @@
 
     // Similarly, increment the coordinate LSA seq. no only if link-state is disabled.
     if (hypState != HYPERBOLIC_STATE_OFF) {
-      if (m_adjLsaSeq != 0 &&
-          hypState == HYPERBOLIC_STATE_ON) {
+      if (m_adjLsaSeq != 0) {
         _LOG_WARN("This router was previously configured for link-state"
                   << " routing without clearing the seq. no. file.");
         m_adjLsaSeq = 0;
       }
       m_corLsaSeq += 10;
     }
-    m_nameLsaSeq += 10;
-    combineSequenceNo();
-    inputFile.close();
   }
-  else {
-    splitSequenceNo(0);
-  }
+  writeLog();
 }
 
 void
-SequencingManager::setSeqFileName(string filePath)
+SequencingManager::setSeqFileDirectory(string filePath)
 {
   m_seqFileNameWithPath = filePath;
+
   if (m_seqFileNameWithPath.empty()) {
-    m_seqFileNameWithPath = getUserHomeDirectory();
+    string homeDirPath(getpwuid(getuid())->pw_dir);
+    if (homeDirPath.empty()) {
+      homeDirPath = getenv("HOME");
+    }
+    m_seqFileNameWithPath = homeDirPath;
   }
   m_seqFileNameWithPath = m_seqFileNameWithPath + "/nlsrSeqNo.txt";
 }
 
-string
-SequencingManager::getUserHomeDirectory()
-{
-  string homeDirPath(getpwuid(getuid())->pw_dir);
-  if (homeDirPath.empty()) {
-    homeDirPath = getenv("HOME");
-  }
-  return homeDirPath;
-}
-
 void
 SequencingManager::writeLog() const
 {
@@ -126,7 +133,6 @@
   _LOG_DEBUG("Adj LSA seq no: " << m_adjLsaSeq);
   _LOG_DEBUG("Cor LSA Seq no: " << m_corLsaSeq);
   _LOG_DEBUG("Name LSA Seq no: " << m_nameLsaSeq);
-  _LOG_DEBUG("Combined LSDB Seq no: " << m_combinedSeqNo);
 }
 
 } // namespace nlsr
diff --git a/src/sequencing-manager.hpp b/src/sequencing-manager.hpp
index ce06de8..188cea6 100644
--- a/src/sequencing-manager.hpp
+++ b/src/sequencing-manager.hpp
@@ -39,24 +39,10 @@
     : m_nameLsaSeq(0)
     , m_adjLsaSeq(0)
     , m_corLsaSeq(0)
-    , m_combinedSeqNo(0)
     , m_seqFileNameWithPath()
   {
   }
 
-  SequencingManager(uint64_t seqNo)
-  {
-    splitSequenceNo(seqNo);
-  }
-
-  SequencingManager(uint64_t nlsn, uint64_t alsn, uint64_t clsn)
-  {
-    m_nameLsaSeq = nlsn;
-    m_adjLsaSeq  = alsn;
-    m_corLsaSeq  = clsn;
-    combineSequenceNo();
-  }
-
   uint64_t
   getNameLsaSeq() const
   {
@@ -67,7 +53,6 @@
   setNameLsaSeq(uint64_t nlsn)
   {
     m_nameLsaSeq = nlsn;
-    combineSequenceNo();
   }
 
   uint64_t
@@ -80,7 +65,6 @@
   setAdjLsaSeq(uint64_t alsn)
   {
     m_adjLsaSeq = alsn;
-    combineSequenceNo();
   }
 
   uint64_t
@@ -93,34 +77,24 @@
   setCorLsaSeq(uint64_t clsn)
   {
     m_corLsaSeq = clsn;
-    combineSequenceNo();
   }
 
   void
   increaseNameLsaSeq()
   {
     m_nameLsaSeq++;
-    combineSequenceNo();
   }
 
   void
   increaseAdjLsaSeq()
   {
     m_adjLsaSeq++;
-    combineSequenceNo();
   }
 
   void
   increaseCorLsaSeq()
   {
     m_corLsaSeq++;
-    combineSequenceNo();
-  }
-
-  uint64_t
-  getCombinedSeqNo() const
-  {
-    return m_combinedSeqNo;
   }
 
   void
@@ -129,29 +103,24 @@
   void
   initiateSeqNoFromFile(int hypState);
 
-  void
-  setSeqFileName(std::string filePath);
+  /*! \brief Set the sequence file directory
 
-  std::string
-  getUserHomeDirectory();
+    If the string is empty, home directory is set as sequence file directory
+
+  \param filePath The directory where sequence file will be stored
+ */
+  void
+  setSeqFileDirectory(std::string filePath);
 
   void
   writeLog() const;
 
 private:
-  void
-  splitSequenceNo(uint64_t seqNo);
-
-  void
-  combineSequenceNo();
-
-private:
   uint64_t m_nameLsaSeq;
   uint64_t m_adjLsaSeq;
   uint64_t m_corLsaSeq;
-  uint64_t m_combinedSeqNo;
   std::string m_seqFileNameWithPath;
 };
 
 } // namespace nlsr
-#endif //NLSR_SEQUENCING_MANAGER_HPP
+#endif // NLSR_SEQUENCING_MANAGER_HPP
diff --git a/src/update/nfd-rib-command-processor.cpp b/src/update/nfd-rib-command-processor.cpp
index f4baeb5..e90503a 100644
--- a/src/update/nfd-rib-command-processor.cpp
+++ b/src/update/nfd-rib-command-processor.cpp
@@ -33,12 +33,10 @@
 
 NfdRibCommandProcessor::NfdRibCommandProcessor(ndn::mgmt::Dispatcher& dispatcher,
                                                NamePrefixList& namePrefixes,
-                                               Lsdb& lsdb,
-                                               SyncLogicHandler& sync)
+                                               Lsdb& lsdb)
   : m_dispatcher(dispatcher)
   , m_namePrefixList(namePrefixes)
   , m_lsdb(lsdb)
-  , m_sync(sync)
 {
 }
 
@@ -96,7 +94,6 @@
 
   if (m_namePrefixList.insert(castParams.getName())) {
     m_lsdb.buildAndInstallOwnNameLsa();
-    m_sync.publishRoutingUpdate();
   }
 }
 
@@ -110,7 +107,6 @@
 
   if (m_namePrefixList.remove(castParams.getName())) {
     m_lsdb.buildAndInstallOwnNameLsa();
-    m_sync.publishRoutingUpdate();
   }
 }
 
diff --git a/src/update/nfd-rib-command-processor.hpp b/src/update/nfd-rib-command-processor.hpp
index a022b58..239d349 100644
--- a/src/update/nfd-rib-command-processor.hpp
+++ b/src/update/nfd-rib-command-processor.hpp
@@ -26,7 +26,6 @@
 #include "nfd-rib-commands.hpp"
 #include "name-prefix-list.hpp"
 #include "lsdb.hpp"
-#include "communication/sync-logic-handler.hpp"
 
 #include <ndn-cxx/mgmt/nfd/control-command.hpp>
 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
@@ -55,8 +54,7 @@
 public:
   NfdRibCommandProcessor(ndn::mgmt::Dispatcher& dispatcher,
                          NamePrefixList& namePrefixes,
-                         Lsdb& lsdb,
-                         SyncLogicHandler& sync);
+                         Lsdb& lsdb);
 
   /*! \brief Registers an Interest filter with face
 
@@ -116,7 +114,6 @@
   ndn::mgmt::Dispatcher& m_dispatcher;
   NamePrefixList& m_namePrefixList;
   Lsdb& m_lsdb;
-  SyncLogicHandler& m_sync;
 };
 
 } // namespace update
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index e0c8f3b..ad1f9a6 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.cpp
@@ -24,7 +24,6 @@
 #include "lsdb.hpp"
 #include "nlsr.hpp"
 #include "prefix-update-commands.hpp"
-#include "communication/sync-logic-handler.hpp"
 
 #include <ndn-cxx/mgmt/nfd/control-response.hpp>
 
@@ -40,7 +39,6 @@
 PrefixUpdateProcessor::PrefixUpdateProcessor(ndn::Face& face,
                                              NamePrefixList& namePrefixList,
                                              Lsdb& lsdb,
-                                             SyncLogicHandler& sync,
                                              const ndn::Name broadcastPrefix,
                                              ndn::KeyChain& keyChain,
                                              std::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
@@ -48,7 +46,6 @@
   : m_face(face)
   , m_namePrefixList(namePrefixList)
   , m_lsdb(lsdb)
-  , m_sync(sync)
   , m_keyChain(keyChain)
   , m_validator(m_face, broadcastPrefix, certificateCache, certStore)
   , m_isEnabled(false)
@@ -153,7 +150,6 @@
   if (m_namePrefixList.insert(parameters.getName())) {
     // Only build a Name LSA if the added name is new
     m_lsdb.buildAndInstallOwnNameLsa();
-    m_sync.publishRoutingUpdate();
   }
 }
 
@@ -173,7 +169,6 @@
   if (m_namePrefixList.remove(parameters.getName())) {
     // Only build a Name LSA if a name was actually removed
     m_lsdb.buildAndInstallOwnNameLsa();
-    m_sync.publishRoutingUpdate();
   }
 }
 
diff --git a/src/update/prefix-update-processor.hpp b/src/update/prefix-update-processor.hpp
index 4f08bc7..f1a5b50 100644
--- a/src/update/prefix-update-processor.hpp
+++ b/src/update/prefix-update-processor.hpp
@@ -39,7 +39,6 @@
 namespace nlsr {
 
 class Lsdb;
-class SyncLogicHandler;
 
 namespace security {
   class CertificateStore;
@@ -66,7 +65,6 @@
   PrefixUpdateProcessor(ndn::Face& face,
                         NamePrefixList& namePrefixList,
                         Lsdb& lsdb,
-                        SyncLogicHandler& sync,
                         const ndn::Name broadcastPrefix,
                         ndn::KeyChain& keyChain,
                         std::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
@@ -134,7 +132,6 @@
   ndn::Face& m_face;
   NamePrefixList& m_namePrefixList;
   Lsdb& m_lsdb;
-  SyncLogicHandler& m_sync;
   ndn::KeyChain& m_keyChain;
   Validator m_validator;
   bool m_isEnabled;
diff --git a/tests/publisher/publisher-fixture.hpp b/tests/publisher/publisher-fixture.hpp
index 477d7a7..eae6486 100644
--- a/tests/publisher/publisher-fixture.hpp
+++ b/tests/publisher/publisher-fixture.hpp
@@ -38,7 +38,7 @@
   PublisherFixture()
     : face(std::make_shared<ndn::util::DummyClientFace>())
     , nlsr(g_ioService, g_scheduler, std::ref(*face), g_keyChain)
-    , lsdb(nlsr, g_scheduler, nlsr.getSyncLogicHandler())
+    , lsdb(nlsr, g_scheduler)
   {
   }
 
diff --git a/tests/test-lsa-rule.cpp b/tests/test-lsa-rule.cpp
index d60d6a0..e7f6a69 100644
--- a/tests/test-lsa-rule.cpp
+++ b/tests/test-lsa-rule.cpp
@@ -174,7 +174,7 @@
   lsaInterestName.append(ndn::Name("name"));
 
   // This would be the sequence number of its own NameLsa
-  lsaInterestName.appendNumber(nlsr.getSequencingManager().getNameLsaSeq());
+  lsaInterestName.appendNumber(nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 
   // Append version, segmentNo
   lsaInterestName.appendNumber(1).appendNumber(1);
@@ -205,7 +205,7 @@
   lsaInterestName.append(ndn::Name("name"));
 
   // This would be the sequence number of its own NameLsa
-  lsaInterestName.appendNumber(nlsr.getSequencingManager().getNameLsaSeq());
+  lsaInterestName.appendNumber(nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 
   // Append version, segmentNo
   lsaInterestName.appendNumber(1).appendNumber(1);
diff --git a/tests/test-lsdb.cpp b/tests/test-lsdb.cpp
index 5d1613c..abd58d4 100644
--- a/tests/test-lsdb.cpp
+++ b/tests/test-lsdb.cpp
@@ -41,7 +41,7 @@
   LsdbFixture()
     : face(std::make_shared<ndn::util::DummyClientFace>(g_ioService))
     , nlsr(g_ioService, g_scheduler, std::ref(*face), g_keyChain)
-    , sync(*face, nlsr.getLsdb(), nlsr.getConfParameter(), nlsr.getSequencingManager())
+    , sync(*face, nlsr.getLsdb(), nlsr.getConfParameter())
     , lsdb(nlsr.getLsdb())
     , conf(nlsr.getConfParameter())
     , REGISTER_COMMAND_PREFIX("/localhost/nfd/rib")
@@ -243,7 +243,7 @@
   //1800 is the default life time.
   NameLsa nlsa1(ndn::Name("/router1/1"), 12, testTimePoint, npl1);
 
-  Lsdb lsdb1(nlsr, g_scheduler, nlsr.getSyncLogicHandler());
+  Lsdb lsdb1(nlsr, g_scheduler);
 
   lsdb1.installNameLsa(nlsa1);
   lsdb1.writeNameLsdbLog();
diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp
index 3553a43..3760289 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.cpp
@@ -190,7 +190,7 @@
   BOOST_REQUIRE(lsa != nullptr);
 
   uint32_t lastAdjLsaSeqNo = lsa->getLsSeqNo();
-  nlsr.getSequencingManager().setAdjLsaSeq(lastAdjLsaSeqNo);
+  nlsr.getLsdb().getSequencingManager().setAdjLsaSeq(lastAdjLsaSeqNo);
 
   // Make sure the routing table was calculated
   RoutingTableEntry* rtEntry = nlsr.getRoutingTable().findRoutingTableEntry(failNeighbor.getName());
diff --git a/tests/test-sequencing-manager.cpp b/tests/test-sequencing-manager.cpp
index 186e7df..e05597f 100644
--- a/tests/test-sequencing-manager.cpp
+++ b/tests/test-sequencing-manager.cpp
@@ -19,40 +19,103 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
+#include "test-common.hpp"
 #include "sequencing-manager.hpp"
 #include <boost/test/unit_test.hpp>
+#include <boost/filesystem.hpp>
+#include <string>
+#include <iostream>
+#include <fstream>
+
+using namespace ndn;
 
 namespace nlsr {
 
 namespace test {
 
-BOOST_AUTO_TEST_SUITE(TestSequencingManager)
-
-BOOST_AUTO_TEST_CASE(SequencingManagerBasic)
+class SequencingManagerFixture : public BaseFixture
 {
-  SequencingManager sm1(120, 121, 122);
+public:
+  SequencingManagerFixture()
+  : m_seqNumbers("")
+  , m_seqManager()
+  {
+    setFileDir();
+  }
 
-  SequencingManager sm2(sm1.getCombinedSeqNo());
+  ~SequencingManagerFixture()
+  {
+    boost::filesystem::remove(seqFile);
+  }
 
-  BOOST_CHECK_EQUAL(sm2.getNameLsaSeq(), (uint32_t)120);
+  void
+  setFileDir() {
+    m_seqManager.setSeqFileDirectory("/tmp");
+  }
 
-  BOOST_CHECK_EQUAL(sm2.getAdjLsaSeq(), (uint32_t)121);
+  void
+  writeToFile(const std::string& testSeq) {
+    std::ofstream outputFile(seqFile, std::ofstream::trunc);
+    outputFile << testSeq;
+    outputFile.close();
+  }
 
-  BOOST_CHECK_EQUAL(sm2.getCorLsaSeq(), (uint32_t)122);
+  void
+  initiateFromFile(const int& type) {
+    m_seqManager.initiateSeqNoFromFile(type);
+  }
+
+  void
+  checkSeqNumbers(const uint64_t& name, const uint64_t& adj, const uint64_t& cor) {
+    BOOST_CHECK_EQUAL(m_seqManager.getNameLsaSeq(), name);
+
+    BOOST_CHECK_EQUAL(m_seqManager.getAdjLsaSeq(), adj);
+
+    BOOST_CHECK_EQUAL(m_seqManager.getCorLsaSeq(), cor);
+  }
+
+private:
+  std::string m_seqNumbers;
+  std::string seqFile = "/tmp/nlsrSeqNo.txt";
+  SequencingManager m_seqManager;
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestSequencingManager, SequencingManagerFixture)
+
+BOOST_AUTO_TEST_CASE(CombinedSeqNumber)
+{
+  // LS
+  writeToFile("27121653322350672");
+
+  initiateFromFile(HYPERBOLIC_STATE_OFF);
+
+  checkSeqNumbers(24667+10, 80+10, 0);
+
+  // HR
+  writeToFile("27121653322350672");
+
+  initiateFromFile(HYPERBOLIC_STATE_ON);
+
+  // AdjLsa is set to 0 since HR is on
+  checkSeqNumbers(24667+10, 0, 0+10);
 }
 
-BOOST_AUTO_TEST_CASE(BitMask)
+BOOST_AUTO_TEST_CASE(SeparateSeqNumber)
 {
-  uint64_t nameLsaSeqNoMax = 0xFFFFFF;
-  uint64_t corLsaSeqNoMax = 0xFFFFF;
-  uint64_t adjLsaSeqNoMax = 0xFFFFF;
+  // LS
+  writeToFile("NameLsaSeq 100\nAdjLsaSeq 100\nCorLsaSeq 0");
 
-  uint64_t seqNo = (nameLsaSeqNoMax << 40) | (corLsaSeqNoMax << 20) | adjLsaSeqNoMax;
-  SequencingManager manager(seqNo);
+  initiateFromFile(HYPERBOLIC_STATE_OFF);
 
-  BOOST_CHECK_EQUAL(manager.getNameLsaSeq(), nameLsaSeqNoMax);
-  BOOST_CHECK_EQUAL(manager.getCorLsaSeq(), corLsaSeqNoMax);
-  BOOST_CHECK_EQUAL(manager.getAdjLsaSeq(), adjLsaSeqNoMax);
+  checkSeqNumbers(100+10, 100+10, 0);
+
+  // HR
+  writeToFile("NameLsa 100\nAdjLsa 0\nCorLsa 100");
+
+  initiateFromFile(HYPERBOLIC_STATE_ON);
+
+  // AdjLsa is set to 0 since HR is on
+  checkSeqNumbers(100+10, 0, 100+10);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-sync-logic-handler.cpp b/tests/test-sync-logic-handler.cpp
index ef990cf..ea23571 100644
--- a/tests/test-sync-logic-handler.cpp
+++ b/tests/test-sync-logic-handler.cpp
@@ -37,7 +37,7 @@
   SyncLogicFixture()
     : face(std::make_shared<ndn::util::DummyClientFace>())
     , nlsr(g_ioService, g_scheduler, std::ref(*face), g_keyChain)
-    , sync(nlsr.getSyncLogicHandler())
+    , sync(nlsr.getLsdb().getSyncLogicHandler())
     , CONFIG_NETWORK("/ndn")
     , CONFIG_SITE("/site")
     , CONFIG_ROUTER_NAME("/%C1.Router/this-router")
@@ -72,34 +72,38 @@
   const std::string CONFIG_NETWORK;
   const std::string CONFIG_SITE;
   const std::string CONFIG_ROUTER_NAME;
+  const std::vector<std::string> lsaTypes = {NameLsa::TYPE_STRING, AdjLsa::TYPE_STRING,
+                                             CoordinateLsa::TYPE_STRING};
 };
 
 BOOST_FIXTURE_TEST_SUITE(TestSyncLogicHandler, SyncLogicFixture)
 
 BOOST_AUTO_TEST_CASE(UpdateForOtherLS)
 {
-  std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
-                           CONFIG_SITE + "/%C1.Router/other-router/";
+  std::vector<std::string> lsaTypes = {NameLsa::TYPE_STRING, AdjLsa::TYPE_STRING};
 
   uint64_t syncSeqNo = 1;
-  receiveUpdate(updateName, syncSeqNo, sync);
 
-  std::vector<ndn::Interest>& interests = face->sentInterests;
+  for (const std::string& lsaType : lsaTypes) {
+    std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
+                             CONFIG_SITE + "/%C1.Router/other-router/" + lsaType;
 
-  std::vector<ndn::Interest>::iterator it = interests.begin();
+    receiveUpdate(updateName, syncSeqNo, sync);
 
-  BOOST_REQUIRE_EQUAL(interests.size(), 2);
+    std::vector<ndn::Interest>& interests = face->sentInterests;
 
-  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + NameLsa::TYPE_STRING + "/");
+    std::vector<ndn::Interest>::iterator it = interests.begin();
 
-  ++it;
-  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + AdjLsa::TYPE_STRING + "/");
+    BOOST_REQUIRE_EQUAL(interests.size(), 1);
+
+    BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + "/");
+  }
 }
 
 BOOST_AUTO_TEST_CASE(UpdateForOtherHR)
 {
   Nlsr nlsr_hr(g_ioService, g_scheduler, std::ref(*face), g_keyChain);
-  SyncLogicHandler& sync_hr(nlsr_hr.getSyncLogicHandler());
+  SyncLogicHandler& sync_hr(nlsr_hr.getLsdb().getSyncLogicHandler());
 
   nlsr_hr.getConfParameter().setNetwork(CONFIG_NETWORK);
   nlsr_hr.getConfParameter().setSiteName(CONFIG_SITE);
@@ -110,30 +114,30 @@
 
   nlsr_hr.initialize();
 
-  std::string updateName = nlsr_hr.getConfParameter().getLsaPrefix().toUri() +
-                           CONFIG_SITE + "/%C1.Router/other-router/";
+  uint64_t syncSeqNo = 1;
 
-  uint64_t syncSeqNo = 0;
-  syncSeqNo = syncSeqNo | (static_cast<uint64_t>(1) << 20);
+  std::vector<std::string> lsaTypes = {NameLsa::TYPE_STRING, CoordinateLsa::TYPE_STRING};
 
-  receiveUpdate(updateName, syncSeqNo, sync_hr);
+  for (const std::string& lsaType : lsaTypes) {
+    std::string updateName = nlsr_hr.getConfParameter().getLsaPrefix().toUri() +
+                           CONFIG_SITE + "/%C1.Router/other-router/" + lsaType;
 
-  std::vector<ndn::Interest>& interests = face->sentInterests;
-  std::vector<ndn::Interest>::iterator it = interests.begin();
+    receiveUpdate(updateName, syncSeqNo, sync_hr);
 
-  BOOST_REQUIRE_EQUAL(interests.size(), 2);
+    std::vector<ndn::Interest>& interests = face->sentInterests;
+    std::vector<ndn::Interest>::iterator it = interests.begin();
 
-  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + NameLsa::TYPE_STRING + "/");
+    BOOST_REQUIRE_EQUAL(interests.size(), 1);
 
-  ++it;
-  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + CoordinateLsa::TYPE_STRING + "/");
+    BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + "/");
+  }
 }
 
 BOOST_AUTO_TEST_CASE(UpdateForOtherHRDry)
 {
 
   Nlsr nlsr_hrdry(g_ioService, g_scheduler, std::ref(*face),g_keyChain);
-  SyncLogicHandler& sync_hrdry(nlsr_hrdry.getSyncLogicHandler());
+  SyncLogicHandler& sync_hrdry(nlsr_hrdry.getLsdb().getSyncLogicHandler());
 
   nlsr_hrdry.getConfParameter().setNetwork(CONFIG_NETWORK);
   nlsr_hrdry.getConfParameter().setSiteName(CONFIG_SITE);
@@ -144,56 +148,50 @@
 
   nlsr_hrdry.initialize();
 
-  std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
-                           CONFIG_SITE + "/%C1.Router/other-router/";
+  for (const std::string& lsaType : lsaTypes) {
+
+    std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
+                 CONFIG_SITE + "/%C1.Router/other-router/" + lsaType;
 
 
-  uint64_t syncSeqNo = 1;
-  syncSeqNo = syncSeqNo | (static_cast<uint64_t>(1) << 20);
-  receiveUpdate(updateName, syncSeqNo, sync_hrdry);
+    uint64_t syncSeqNo = 1;
 
-  std::vector<ndn::Interest>& interests = face->sentInterests;
-  std::vector<ndn::Interest>::iterator it = interests.begin();
+    receiveUpdate(updateName, syncSeqNo, sync_hrdry);
 
-  BOOST_REQUIRE_EQUAL(interests.size(), 3);
+    std::vector<ndn::Interest>& interests = face->sentInterests;
 
-  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + NameLsa::TYPE_STRING + "/");
+    std::vector<ndn::Interest>::iterator it = interests.begin();
 
-  if (nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
-      ++it;
-      BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + CoordinateLsa::TYPE_STRING + "/");
-  }
-  else if (nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
-      ++it;
-      BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + AdjLsa::TYPE_STRING + "/");
-  }
-  else {
-      ++it;
-      BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + CoordinateLsa::TYPE_STRING + "/");
-
-      ++it;
-      BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + AdjLsa::TYPE_STRING + "/");
+    // In HR dry-state all LSA's should be published
+    BOOST_REQUIRE_EQUAL(interests.size(), 1);
+    BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + "/");
   }
 }
 
+
 BOOST_AUTO_TEST_CASE(NoUpdateForSelf)
 {
-  std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
-                           CONFIG_SITE + CONFIG_ROUTER_NAME;
+  for (const std::string& lsaType : lsaTypes) {
+    std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
+                             CONFIG_SITE + CONFIG_ROUTER_NAME + lsaType;
 
-  receiveUpdate(updateName, 1, sync);
+    receiveUpdate(updateName, 1, sync);
 
-  std::vector<ndn::Interest>& interests = face->sentInterests;
-  BOOST_CHECK_EQUAL(interests.size(), 0);
+    std::vector<ndn::Interest>& interests = face->sentInterests;
+    BOOST_CHECK_EQUAL(interests.size(), 0);
+  }
 }
 
+
 BOOST_AUTO_TEST_CASE(MalformedUpdate)
 {
-  std::string updateName = CONFIG_SITE + nlsr.getConfParameter().getLsaPrefix().toUri() +
-                           CONFIG_ROUTER_NAME;
+  for (const std::string& lsaType : lsaTypes) {
+    std::string updateName = CONFIG_SITE + nlsr.getConfParameter().getLsaPrefix().toUri() +
+                             CONFIG_ROUTER_NAME + lsaType;
 
-  std::vector<ndn::Interest>& interests = face->sentInterests;
-  BOOST_CHECK_EQUAL(interests.size(), 0);
+    std::vector<ndn::Interest>& interests = face->sentInterests;
+    BOOST_CHECK_EQUAL(interests.size(), 0);
+  }
 }
 
 BOOST_AUTO_TEST_CASE(SequenceNumber)
@@ -219,31 +217,31 @@
   lsdb.installCoordinateLsa(corLsa);
 
   std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
-                           CONFIG_SITE + "/%C1.Router/other-router/";
+                           CONFIG_SITE + "/%C1.Router/other-router/" + NameLsa::TYPE_STRING;
 
   // Lower NameLSA sequence number
-  uint64_t lowerSeqNo = static_cast<uint64_t>(998) << 40;
+  uint64_t lowerSeqNo = 998;
   receiveUpdate(updateName, lowerSeqNo, sync);
 
   std::vector<ndn::Interest>& interests = face->sentInterests;
   BOOST_REQUIRE_EQUAL(interests.size(), 0);
 
   // Same NameLSA sequence number
-  uint64_t sameSeqNo = static_cast<uint64_t>(999) << 40;
+  uint64_t sameSeqNo = 999;
   receiveUpdate(updateName, sameSeqNo, sync);
 
   interests = face->sentInterests;
   BOOST_REQUIRE_EQUAL(interests.size(), 0);
 
   // Higher NameLSA sequence number
-  uint64_t higherSeqNo = static_cast<uint64_t>(1000) << 40;
+  uint64_t higherSeqNo = 1000;
   receiveUpdate(updateName, higherSeqNo, sync);
 
   interests = face->sentInterests;
   BOOST_REQUIRE_EQUAL(interests.size(), 1);
 
   std::vector<ndn::Interest>::iterator it = interests.begin();
-  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + "name/");
+  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + "/");
 }
 
 BOOST_AUTO_TEST_CASE(UpdatePrefix)
@@ -254,7 +252,9 @@
 
   nlsr.initialize();
 
-  BOOST_CHECK_EQUAL(sync.m_updatePrefix, expectedPrefix);
+  BOOST_CHECK_EQUAL(sync.m_nameLsaUserPrefix, ndn::Name(expectedPrefix).append(NameLsa::TYPE_STRING));
+  BOOST_CHECK_EQUAL(sync.m_adjLsaUserPrefix, ndn::Name(expectedPrefix).append(AdjLsa::TYPE_STRING));
+  BOOST_CHECK_EQUAL(sync.m_coorLsaUserPrefix, ndn::Name(expectedPrefix).append(CoordinateLsa::TYPE_STRING));
 }
 
 BOOST_AUTO_TEST_CASE(CreateSyncSocketOnInitialization) // Bug #2649
@@ -267,7 +267,7 @@
   BOOST_REQUIRE(lsa == nullptr);
 
   // Publish a routing update before an Adjacency LSA is built
-  BOOST_CHECK_NO_THROW(sync.publishRoutingUpdate());
+  BOOST_CHECK_NO_THROW(sync.publishRoutingUpdate(AdjLsa::TYPE_STRING, 0));
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/update/test-nfd-rib-command-processor.cpp b/tests/update/test-nfd-rib-command-processor.cpp
index 3c0ae47..81b66ce 100644
--- a/tests/update/test-nfd-rib-command-processor.cpp
+++ b/tests/update/test-nfd-rib-command-processor.cpp
@@ -56,6 +56,8 @@
 
     this->advanceClocks(ndn::time::milliseconds(10));
     face.sentInterests.clear();
+
+    nameLsaSeqNoBeforeInterest = nlsr.getLsdb().getSequencingManager().getNameLsaSeq();
   }
 
   std::shared_ptr<ndn::Interest>
@@ -73,9 +75,11 @@
     // no longer does face->put(*data) in publishData.
     // Instead it does it in onInterest
     ndn::Name lsaInterestName("/localhop/ndn/NLSR/LSA");
+    lsaInterestName.append(NameLsa::TYPE_STRING);
+
     // The part after LSA is Chronosync getSession
     lsaInterestName.append(sessionTime);
-    lsaInterestName.appendNumber(nlsr.getSequencingManager().getCombinedSeqNo());
+    lsaInterestName.appendNumber(nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
     shared_ptr<ndn::Interest> lsaInterest = make_shared<ndn::Interest>(lsaInterestName);
 
     face.receive(*lsaInterest);
@@ -89,7 +93,7 @@
     const ndn::Name& lsaPrefix = nlsr.getConfParameter().getLsaPrefix();
 
     const auto& it = std::find_if(face.sentData.begin(), face.sentData.end(),
-      [lsaPrefix] (const ndn::Data& data) {
+      [&] (const ndn::Data& data) {
         return lsaPrefix.isPrefixOf(data.getName());
       });
 
@@ -104,6 +108,7 @@
   NamePrefixList& namePrefixes;
   NfdRibCommandProcessor& processor;
   ndn::Name sessionTime;
+  uint64_t nameLsaSeqNoBeforeInterest;
 };
 
 typedef boost::mpl::vector<NfdRibRegisterCommand, NfdRibUnregisterCommand> Commands;
@@ -150,6 +155,7 @@
   }
   BOOST_CHECK_EQUAL((*itr), parameters.getName());
   BOOST_CHECK(wasRoutingUpdatePublished());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_CASE(RemovePrefix)
@@ -170,6 +176,7 @@
     BOOST_FAIL("Prefix was not removed!");
   }
   BOOST_CHECK(wasRoutingUpdatePublished());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_CASE(onReceiveInterestRegisterCommand)
@@ -192,6 +199,7 @@
   }
   BOOST_CHECK_EQUAL((*itr), prefixName);
   BOOST_CHECK(wasRoutingUpdatePublished());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_CASE(onReceiveInterestUnregisterCommand)
@@ -210,6 +218,7 @@
 
   BOOST_CHECK_EQUAL(namePrefixes.getNameList().size(), 0);
   BOOST_CHECK(wasRoutingUpdatePublished());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_CASE(onReceiveInterestInvalidPrefix)
@@ -225,7 +234,10 @@
   this->advanceClocks(ndn::time::milliseconds(10));
 
   BOOST_CHECK_EQUAL(namePrefixes.getNameList().size(), 0);
-  BOOST_CHECK(!wasRoutingUpdatePublished());
+
+  // Cannot use routingUpdatePublish test now since in
+  // initialize nlsr calls buildOwnNameLsa which publishes the routing update
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest == nlsr.getLsdb().getSequencingManager().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 169fc48..efb24a0 100644
--- a/tests/update/test-prefix-update-processor.cpp
+++ b/tests/update/test-prefix-update-processor.cpp
@@ -161,9 +161,12 @@
     // no longer does face->put(*data) in publishData.
     // Instead it does it in onInterest
     ndn::Name lsaInterestName("/localhop/ndn/NLSR/LSA");
+    lsaInterestName.append(NameLsa::TYPE_STRING);
+
     // The part after LSA is Chronosync getSession
     lsaInterestName.append(sessionTime);
-    lsaInterestName.appendNumber(nlsr.getSequencingManager().getCombinedSeqNo());
+    lsaInterestName.appendNumber(nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
+
     shared_ptr<Interest> lsaInterest = make_shared<Interest>(lsaInterestName);
 
     face.receive(*lsaInterest);
@@ -231,6 +234,7 @@
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
+  uint64_t nameLsaSeqNoBeforeInterest = nlsr.getLsdb().getSequencingManager().getNameLsaSeq();
   updateProcessor.enable();
 
   // Advertise
@@ -252,8 +256,10 @@
   BOOST_CHECK_EQUAL(namePrefixList.getNameList().front(), parameters.getName());
 
   BOOST_CHECK(wasRoutingUpdatePublished());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 
   face.sentData.clear();
+  nameLsaSeqNoBeforeInterest = nlsr.getLsdb().getSequencingManager().getNameLsaSeq();
 
   // Withdraw
   ndn::Name withdrawCommand("/localhost/nlsr/prefix-update/withdraw");
@@ -268,6 +274,7 @@
   BOOST_CHECK_EQUAL(namePrefixList.getSize(), 0);
 
   BOOST_CHECK(wasRoutingUpdatePublished());
+  BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.getLsdb().getSequencingManager().getNameLsaSeq());
 }
 
 BOOST_AUTO_TEST_CASE(DisabledAndEnabled)
