diff --git a/nsync/sync-logic.cc b/nsync/sync-logic.cc
index af864d3..2a748c3 100644
--- a/nsync/sync-logic.cc
+++ b/nsync/sync-logic.cc
@@ -665,13 +665,15 @@
   char *wireData = new char[size];
   ssm.SerializeToArray(wireData, size);
 
-  Data syncData(name);
-  syncData.setContent(reinterpret_cast<const uint8_t*>(wireData), size);
-  syncData.setFreshnessPeriod(ndn::time::seconds(m_syncResponseFreshness));
+  //Data syncData(name);
+  ndn::shared_ptr<ndn::Data> syncData = ndn::make_shared<ndn::Data>();
+  syncData->setName(name);
+  syncData->setContent(reinterpret_cast<const uint8_t*>(wireData), size);
+  syncData->setFreshnessPeriod(ndn::time::seconds(m_syncResponseFreshness));
 
-  m_keyChain->sign(syncData);
+  m_keyChain->sign(*syncData);
 
-  m_face->put(syncData);
+  m_face->put(*syncData);
 
   delete []wireData;
 
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 41df359..ad6709c 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -93,13 +93,14 @@
   neighbor.wireDecode(interestName.get(-1).blockFromValue());
   _LOG_DEBUG("Neighbor: " << neighbor);
   if (m_nlsr.getAdjacencyList().isNeighbor(neighbor)) {
-    ndn::Data data(ndn::Name(interest.getName()).appendVersion());
-    data.setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
-    data.setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
+    ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+    data->setName(ndn::Name(interest.getName()).appendVersion());
+    data->setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
+    data->setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
                     INFO_COMPONENT.size());
-    m_nlsr.getKeyChain().sign(data, m_nlsr.getDefaultCertName());
-    _LOG_DEBUG("Sending out data for name: " << data.getName());
-    m_nlsr.getNlsrFace().put(data);
+    m_nlsr.getKeyChain().sign(*data, m_nlsr.getDefaultCertName());
+    _LOG_DEBUG("Sending out data for name: " << interest.getName());
+    m_nlsr.getNlsrFace().put(*data);
     Adjacent *adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor);
     if (adjacent->getStatus() == 0) {
       if(adjacent->getFaceId() != 0){
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index c5e7756..5076f5e 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -804,6 +804,18 @@
 }
 
 void
+Lsdb::putLsaData(const ndn::Interest& interest, const std::string& content)
+{
+  ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+  data->setName(ndn::Name(interest.getName()).appendVersion());
+  data->setFreshnessPeriod(ndn::time::seconds(10));
+  data->setContent(reinterpret_cast<const uint8_t*>(content.c_str()), content.size());
+  m_nlsr.getKeyChain().sign(*data, m_nlsr.getDefaultCertName());
+  _LOG_DEBUG("Sending data for LSA(name): " << interest.getName());
+  m_nlsr.getNlsrFace().put(*data);
+}
+
+void
 Lsdb::processInterestForNameLsa(const ndn::Interest& interest,
                                 const ndn::Name& lsaKey,
                                 uint32_t interestedlsSeqNo)
@@ -811,14 +823,8 @@
   NameLsa*  nameLsa = m_nlsr.getLsdb().findNameLsa(lsaKey);
   if (nameLsa != 0) {
     if (nameLsa->getLsSeqNo() >= interestedlsSeqNo) {
-      ndn::Data data(ndn::Name(interest.getName()).appendVersion());
-      _LOG_DEBUG("Sending data for LSA(name): " << interest.getName());
-      data.setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
       std::string content = nameLsa->getData();
-      data.setContent(reinterpret_cast<const uint8_t*>(content.c_str()),
-                      content.size());
-      m_nlsr.getKeyChain().sign(data, m_nlsr.getDefaultCertName());
-      m_nlsr.getNlsrFace().put(data);
+      putLsaData(interest,content);
     }
   }
 }
@@ -831,14 +837,8 @@
   AdjLsa* adjLsa = m_nlsr.getLsdb().findAdjLsa(lsaKey);
   if (adjLsa != 0) {
     if (adjLsa->getLsSeqNo() >= interestedlsSeqNo) {
-      ndn::Data data(ndn::Name(interest.getName()).appendVersion());
-      _LOG_DEBUG("Sending data for LSA(name): " << interest.getName());
-      data.setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
       std::string content = adjLsa->getData();
-      data.setContent(reinterpret_cast<const uint8_t*>(content.c_str()),
-                      content.size());
-      m_nlsr.getKeyChain().sign(data, m_nlsr.getDefaultCertName());
-      m_nlsr.getNlsrFace().put(data);
+      putLsaData(interest,content);
     }
   }
 }
@@ -851,14 +851,8 @@
   CoordinateLsa* corLsa = m_nlsr.getLsdb().findCoordinateLsa(lsaKey);
   if (corLsa != 0) {
     if (corLsa->getLsSeqNo() >= interestedlsSeqNo) {
-      ndn::Data data(ndn::Name(interest.getName()).appendVersion());
-      _LOG_DEBUG("Sending data for LSA(name): " << interest.getName());
-      data.setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
       std::string content = corLsa->getData();
-      data.setContent(reinterpret_cast<const uint8_t*>(content.c_str()),
-                      content.size());
-      m_nlsr.getKeyChain().sign(data, m_nlsr.getDefaultCertName());
-      m_nlsr.getNlsrFace().put(data);
+      putLsaData(interest,content);
     }
   }
 }
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 7c6ceb1..64de8ec 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -165,6 +165,9 @@
 
 private:
   void
+  putLsaData(const ndn::Interest& interest, const std::string& content);
+
+  void
   processInterestForNameLsa(const ndn::Interest& interest,
                             const ndn::Name& lsaKey,
                             uint32_t interestedlsSeqNo);
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 2285d85..5fef3bf 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -164,11 +164,12 @@
   if (!static_cast<bool>(cert))
     return; // cert is not found
 
-  Data data(interestName);
-  data.setContent(cert->wireEncode());
-  m_keyChain.signWithSha256(data);
+  ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+  data->setName(interestName);
+  data->setContent(cert->wireEncode());
+  m_keyChain.signWithSha256(*data);
 
-  m_nlsrFace.put(data);
+  m_nlsrFace.put(*data);
 }
 
 void
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 1c39d51..57bf6b2 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -242,7 +242,6 @@
                                                                 RoutingTable& rt, Map& pMap, int sourceRouter)
 {
   _LOG_DEBUG("LinkStateRoutingTableCalculator::addAllNextHopsToRoutingTable Called");
-  std::cout << std::endl;
   int nextHopRouter = 0;
   for (int i = 0; i < numOfRouter ; i++) {
     if (i != sourceRouter) {
