diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 10a40ec..85b1da0 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -14,12 +14,12 @@
 {
   std::cout << "Creating Sync socket ......" << std::endl;
   std::cout << "Sync prefix: " << m_syncPrefix << std::endl;
-  m_syncSocket = make_shared<Sync::SyncSocket>(m_syncPrefix, m_validator,
-                                               m_syncFace,
-                                               bind(&SyncLogicHandler::nsyncUpdateCallBack, this,
-                                                    _1, _2, boost::ref(pnlsr)),
-                                               bind(&SyncLogicHandler::nsyncRemoveCallBack, this,
-                                                    _1, boost::ref(pnlsr)));
+  m_syncSocket = ndn::make_shared<Sync::SyncSocket>(m_syncPrefix, m_validator,
+                                                    m_syncFace,
+                                                    ndn::bind(&SyncLogicHandler::nsyncUpdateCallBack,
+                                                              this, _1, _2, ndn::ref(pnlsr)),
+                                                    ndn::bind(&SyncLogicHandler::nsyncRemoveCallBack,
+                                                              this, _1, ndn::ref(pnlsr)));
 }
 
 void
@@ -28,8 +28,7 @@
 {
   std::cout << "nsyncUpdateCallBack called ...." << std::endl;
   int32_t n = v.size();
-  for (int32_t i = 0; i < n; i++)
-  {
+  for (int32_t i = 0; i < n; i++){
     std::cout << "Data Name: " << v[i].prefix << " Seq: " << v[i].high.getSeq() <<
               endl;
     processUpdateFromSync(v[i].prefix, v[i].high.getSeq(), pnlsr);
@@ -51,11 +50,9 @@
 SyncLogicHandler::processUpdateFromSync(const ndn::Name& updateName,
                                         uint64_t seqNo,  Nlsr& pnlsr)
 {
-  //const ndn::Name name(updateName);
   string chkString("LSA");
   int32_t lasPosition = util::getNameComponentPosition(updateName, chkString);
-  if (lasPosition >= 0)
-  {
+  if (lasPosition >= 0) {
     ndn::Name routerName = updateName.getSubName(lasPosition + 1);
     processRoutingUpdateFromSync(routerName, seqNo, pnlsr);
     return;
@@ -67,17 +64,14 @@
                                                uint64_t seqNo,  Nlsr& pnlsr)
 {
   ndn::Name rName = routerName;
-  if (routerName != pnlsr.getConfParameter().getRouterPrefix())
-  {
+  if (routerName != pnlsr.getConfParameter().getRouterPrefix()) {
     SequencingManager sm(seqNo);
     std::cout << sm;
     std::cout << "Router Name: " << routerName << endl;
-    try
-    {
-      if (pnlsr.getLsdb().isNameLsaNew(rName.append("name"), sm.getNameLsaSeq()))
-      {
+    try {
+      if (pnlsr.getLsdb().isNameLsaNew(rName.append("name"), sm.getNameLsaSeq())) {
         std::cout << "Updated Name LSA. Need to fetch it" << std::endl;
-        ndn::Name interestName(pnlsr.getConfParameter().getChronosyncLsaPrefix());
+        ndn::Name interestName(pnlsr.getConfParameter().getLsaPrefix());
         interestName.append(routerName);
         interestName.append("name");
         interestName.appendNumber(sm.getNameLsaSeq());
@@ -85,10 +79,9 @@
                                         pnlsr.getConfParameter().getInterestResendTime());
       }
       if (pnlsr.getLsdb().isAdjLsaNew(rName.append("adjacency"),
-                                      sm.getAdjLsaSeq()))
-      {
+                                      sm.getAdjLsaSeq())) {
         std::cout << "Updated Adj LSA. Need to fetch it" << std::endl;
-        ndn::Name interestName(pnlsr.getConfParameter().getChronosyncLsaPrefix());
+        ndn::Name interestName(pnlsr.getConfParameter().getLsaPrefix());
         interestName.append(routerName);
         interestName.append("adjacency");
         interestName.appendNumber(sm.getAdjLsaSeq());
@@ -96,10 +89,9 @@
                                         pnlsr.getConfParameter().getInterestResendTime());
       }
       if (pnlsr.getLsdb().isCoordinateLsaNew(rName.append("coordinate"),
-                                             sm.getCorLsaSeq()))
-      {
+                                             sm.getCorLsaSeq())) {
         std::cout << "Updated Cor LSA. Need to fetch it" << std::endl;
-        ndn::Name interestName(pnlsr.getConfParameter().getChronosyncLsaPrefix());
+        ndn::Name interestName(pnlsr.getConfParameter().getLsaPrefix());
         interestName.append(routerName);
         interestName.append("coordinate");
         interestName.appendNumber(sm.getCorLsaSeq());
@@ -107,8 +99,7 @@
                                         pnlsr.getConfParameter().getInterestResendTime());
       }
     }
-    catch (std::exception& e)
-    {
+    catch (std::exception& e) {
       std::cerr << e.what() << std::endl;
       return;
     }
