diff --git a/src/sync-logic.cc b/src/sync-logic.cc
index 240e9df..67fb342 100644
--- a/src/sync-logic.cc
+++ b/src/sync-logic.cc
@@ -18,6 +18,7 @@
  * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
  *         Chaoyi Bian <bcy@pku.edu.cn>
  *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Yingdi Yu <yingdi@cs.ucla.edu>
  */
 
 #ifdef NS3_MODULE
@@ -179,21 +180,21 @@
  * Recovery name:  .../recovery/<hash>
  */
 boost::tuple<DigestConstPtr, std::string>
-SyncLogic::convertNameToDigestAndType (const std::string &name)
+SyncLogic::convertNameToDigestAndType (const Name &name)
 {
-  BOOST_ASSERT (name.find (m_syncPrefix.toUri()) == 0);
+  BOOST_ASSERT (m_syncPrefix.isPrefixOf(name));
 
-  string hash = name.substr (m_syncPrefix.toUri().size (), name.size ()-m_syncPrefix.toUri().size ());
-  if (hash[0] == '/')
-    hash = hash.substr (1, hash.size ()-1);
-  string interestType = "normal";
-
-  size_t pos = hash.find ('/');
-  if (pos != string::npos)
-    {
-      interestType = hash.substr (0, pos);
-      hash         = hash.substr (pos + 1);
-    }
+  int nameLengthDiff = name.size() - m_syncPrefix.size();
+  BOOST_ASSERT (nameLengthDiff > 0);
+  BOOST_ASSERT (nameLengthDiff < 3);
+  
+  string hash = name.get(-1).toEscapedString();
+  string interestType;
+  
+  if(nameLengthDiff == 1)
+    interestType = "normal";
+  else
+    interestType = name.get(-2).toEscapedString();
 
   _LOG_TRACE (hash << ", " << interestType);
 
@@ -210,8 +211,10 @@
                            Transport& transport, 
                            uint64_t registeredPrefixId)
 {
-  _LOG_DEBUG("respondSyncInterest: " << interest->getName().toUri());
-  string name = interest->getName().toUri();
+  Name name = interest->getName();
+
+  _LOG_DEBUG("respondSyncInterest: " << name);
+
   try
     {
       _LOG_TRACE ("<< I " << name);
@@ -287,7 +290,7 @@
 void
 SyncLogic::onSyncDataVerified(const shared_ptr<Data>& data)
 {
-  string name = data->getName().toUri();
+  Name name = data->getName();
   const char* wireData = (const char*)data->getContent().value();
   size_t len = data->getContent().value_size();
 
@@ -319,7 +322,7 @@
 }
 
 void
-SyncLogic::processSyncInterest (const std::string &name, DigestConstPtr digest, bool timedProcessing/*=false*/)
+SyncLogic::processSyncInterest (const Name &name, DigestConstPtr digest, bool timedProcessing/*=false*/)
 {
   _LOG_DEBUG("processSyncInterest");
   DigestConstPtr rootDigest;
@@ -344,7 +347,7 @@
   if (*rootDigest == *digest)
     {
       _LOG_TRACE ("processSyncInterest (): Same state. Adding to PIT");
-      m_syncInterestTable.insert (digest, name, false);
+      m_syncInterestTable.insert (digest, name.toUri(), false);
       return;
     }
   
@@ -360,7 +363,7 @@
 
   if (!timedProcessing)
     {
-      bool exists = m_syncInterestTable.insert (digest, name, true);
+      bool exists = m_syncInterestTable.insert (digest, name.toUri(), true);
       if (exists) // somebody else replied, so restart random-game timer
         {
           _LOG_DEBUG ("Unknown digest, but somebody may have already replied, so restart our timer");
@@ -384,7 +387,7 @@
 }
 
 void
-SyncLogic::processSyncData (const std::string &name, DigestConstPtr digest, const char *wireData, size_t len)
+SyncLogic::processSyncData (const Name &name, DigestConstPtr digest, const char *wireData, size_t len)
 {
   DiffStatePtr diffLog = boost::make_shared<DiffState> ();
   bool ownInterestSatisfied = false;
@@ -392,7 +395,7 @@
   try
     {
 
-      m_syncInterestTable.remove (name); // Remove satisfied interest from PIT
+      m_syncInterestTable.remove (name.toUri()); // Remove satisfied interest from PIT
 
       ownInterestSatisfied = (name == m_outstandingInterestName);
 
@@ -504,7 +507,7 @@
 }
 
 void
-SyncLogic::processSyncRecoveryInterest (const std::string &name, DigestConstPtr digest)
+SyncLogic::processSyncRecoveryInterest (const Name &name, DigestConstPtr digest)
 {
   _LOG_DEBUG("processSyncRecoveryInterest");
   DiffStateContainer::iterator stateInDiffLog = m_log.find (digest);
@@ -577,13 +580,13 @@
 }
 
 void
-SyncLogic::addLocalNames (const string &prefix, uint32_t session, uint32_t seq)
+SyncLogic::addLocalNames (const Name &prefix, uint32_t session, uint32_t seq)
 {
   DiffStatePtr diff;
   {
     //cout << "Add local names" <<endl;
     boost::recursive_mutex::scoped_lock lock (m_stateMutex);
-    NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
+    NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix.toUri());
 
     _LOG_DEBUG ("addLocalNames (): old state " << *m_state->getDigest ());
 
@@ -602,12 +605,12 @@
 }
 
 void
-SyncLogic::remove(const string &prefix) 
+SyncLogic::remove(const Name &prefix) 
 {
   DiffStatePtr diff;
   {
     boost::recursive_mutex::scoped_lock lock (m_stateMutex);
-    NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
+    NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix.toUri());
     m_state->remove(info);	
 
     // increment the sequence number for the forwarder node
@@ -636,39 +639,41 @@
 SyncLogic::sendSyncInterest ()
 {
   _LOG_DEBUG("sendSyncInterest");
-  ostringstream os;
 
   {
     boost::recursive_mutex::scoped_lock lock (m_stateMutex);
-
-    os << m_syncPrefix << "/" << *m_state->getDigest();
-    m_outstandingInterestName = os.str ();
-    _LOG_TRACE (">> I " << os.str ());
+    m_outstandingInterestName = m_syncPrefix;
+    ostringstream os;
+    os << *m_state->getDigest();
+    m_outstandingInterestName.append(os.str());
+    _LOG_TRACE (">> I " << m_outstandingInterestName);
   }
 
-  _LOG_DEBUG("sendSyncInterest: " << os.str());
+  _LOG_DEBUG("sendSyncInterest: " << m_outstandingInterestName);
 
   m_scheduler.cancel (REEXPRESSING_INTEREST);
   m_scheduler.schedule (TIME_SECONDS_WITH_JITTER (m_syncInterestReexpress),
                         func_lib::bind (&SyncLogic::sendSyncInterest, this),
                         REEXPRESSING_INTEREST);
 
-  shared_ptr<ndn::Interest> interest = make_shared<ndn::Interest>(os.str());
+  ndn::Interest interest(m_outstandingInterestName);
 
   OnVerified onVerified = func_lib::bind(&SyncLogic::onSyncDataVerified, this, _1);
   OnVerifyFailed onVerifyFailed = func_lib::bind(&SyncLogic::onSyncDataVerifyFailed, this, _1);
 
-  m_face->expressInterest(*interest,
+  m_face->expressInterest(interest,
                           func_lib::bind(&SyncLogic::onSyncData, this, _1, _2, onVerified, onVerifyFailed),
-                          func_lib::bind(&SyncLogic::onSyncDataTimeout, this, _1, 1, onVerified, onVerifyFailed));
+                          func_lib::bind(&SyncLogic::onSyncDataTimeout, this, _1, 0, onVerified, onVerifyFailed));
 }
 
 void
 SyncLogic::sendSyncRecoveryInterests (DigestConstPtr digest)
 {
   ostringstream os;
-  os << m_syncPrefix << "/recovery/" << *digest;
-  _LOG_TRACE (">> I " << os.str ());
+  os << *digest;
+  
+  Name interestName = m_syncPrefix;
+  interestName.append("recovery").append(os.str());
 
   TimeDuration nextRetransmission = TIME_MILLISECONDS_WITH_JITTER (m_recoveryRetransmissionInterval);
   m_recoveryRetransmissionInterval <<= 1;
@@ -681,19 +686,19 @@
                             REEXPRESSING_RECOVERY_INTEREST);
     }
 
-  shared_ptr<ndn::Interest> interest = make_shared<ndn::Interest>(os.str());
+  ndn::Interest interest(interestName);
 
   OnVerified onVerified = func_lib::bind(&SyncLogic::onSyncDataVerified, this, _1);
   OnVerifyFailed onVerifyFailed = func_lib::bind(&SyncLogic::onSyncDataVerifyFailed, this, _1);
 
-  m_face->expressInterest(*interest,
+  m_face->expressInterest(interest,
                           func_lib::bind(&SyncLogic::onSyncData, this, _1, _2, onVerified, onVerifyFailed),
-                          func_lib::bind(&SyncLogic::onSyncDataTimeout, this, _1, 1, onVerified, onVerifyFailed));
+                          func_lib::bind(&SyncLogic::onSyncDataTimeout, this, _1, 0, onVerified, onVerifyFailed));
 }
 
 
 void
-SyncLogic::sendSyncData (const std::string &name, DigestConstPtr digest, StateConstPtr state)
+SyncLogic::sendSyncData (const Name &name, DigestConstPtr digest, StateConstPtr state)
 {
   SyncStateMsg msg;
   msg << (*state);
@@ -703,21 +708,19 @@
 // pass in state msg instead of state, so that there is no need to lock the state until
 // this function returns
 void
-SyncLogic::sendSyncData (const std::string &name, DigestConstPtr digest, SyncStateMsg &ssm)
+SyncLogic::sendSyncData (const Name &name, DigestConstPtr digest, SyncStateMsg &ssm)
 {
   _LOG_TRACE (">> D " << name);
   int size = ssm.ByteSize();
   char *wireData = new char[size];
-  Name dataName(name);
-  Name signingIdentity = m_policy->inferSigningIdentity(dataName);
+  Name signingIdentity = m_policy->inferSigningIdentity(name);
 
-  shared_ptr<Data> syncData = make_shared<Data>(dataName);
-  syncData->setContent(reinterpret_cast<const uint8_t*>(wireData), size);
+  Data syncData(name);
+  syncData.setContent(reinterpret_cast<const uint8_t*>(wireData), size);
   
-  Name certificateName = m_keyChain->getDefaultCertificateNameForIdentity(signingIdentity);
-  m_keyChain->sign(*syncData, certificateName);
+  m_keyChain->signByIdentity(syncData, signingIdentity);
   
-  m_face->put(*syncData);
+  m_face->put(syncData);
   
   delete []wireData;
 
diff --git a/src/sync-logic.h b/src/sync-logic.h
index aef6158..d3e70c1 100644
--- a/src/sync-logic.h
+++ b/src/sync-logic.h
@@ -18,6 +18,7 @@
  * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
  *         Chaoyi Bian <bcy@pku.edu.cn>
  *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Yingdi Yu <yingdi@cs.ucla.edu>
  */
 
 #ifndef SYNC_LOGIC_H
@@ -102,7 +103,7 @@
   /**
    * a wrapper for the same func in SyncApp
    */
-  void addLocalNames (const std::string &prefix, uint32_t session, uint32_t seq);
+  void addLocalNames (const ndn::Name &prefix, uint32_t session, uint32_t seq);
 
   /**
    * @brief respond to the Sync Interest; a lot of logic needs to go in here
@@ -121,7 +122,7 @@
    * @brief remove a participant's subtree from the sync tree
    * @param prefix the name prefix for the participant
    */
-  void remove (const std::string &prefix);
+  void remove (const ndn::Name &prefix);
 
   std::string
   getRootDigest();
@@ -187,15 +188,15 @@
   onSyncDataVerified(const ndn::ptr_lib::shared_ptr<ndn::Data>& data);
 
   void
-  processSyncInterest (const std::string &name,
+  processSyncInterest (const ndn::Name &name,
                        DigestConstPtr digest, bool timedProcessing=false);
 
   void
-  processSyncData (const std::string &name,
+  processSyncData (const ndn::Name &name,
                    DigestConstPtr digest, const char *wireData, size_t len);
   
   void
-  processSyncRecoveryInterest (const std::string &name,
+  processSyncRecoveryInterest (const ndn::Name &name,
                                DigestConstPtr digest);
   
   void 
@@ -205,7 +206,7 @@
   satisfyPendingSyncInterests (DiffStateConstPtr diff);
 
   boost::tuple<DigestConstPtr, std::string>
-  convertNameToDigestAndType (const std::string &name);
+  convertNameToDigestAndType (const ndn::Name &name);
 
   void
   sendSyncInterest ();
@@ -214,11 +215,11 @@
   sendSyncRecoveryInterests (DigestConstPtr digest);
 
   void
-  sendSyncData (const std::string &name,
+  sendSyncData (const ndn::Name &name,
                 DigestConstPtr digest, StateConstPtr state);
 
   void
-  sendSyncData (const std::string &name,
+  sendSyncData (const ndn::Name &name,
                 DigestConstPtr digest, SyncStateMsg &msg);
 
   size_t
@@ -229,7 +230,7 @@
   DiffStateContainer m_log;
   mutable boost::recursive_mutex m_stateMutex;
 
-  std::string m_outstandingInterestName;
+  ndn::Name m_outstandingInterestName;
   SyncInterestTable m_syncInterestTable;
 
   ndn::Name m_syncPrefix;
diff --git a/src/sync-socket.cc b/src/sync-socket.cc
index cb00ba4..02fb85d 100644
--- a/src/sync-socket.cc
+++ b/src/sync-socket.cc
@@ -53,22 +53,25 @@
 }
 
 bool 
-SyncSocket::publishData(const std::string &prefix, uint32_t session, const char *buf, size_t len, int freshness)
+SyncSocket::publishData(const Name &prefix, uint32_t session, const char *buf, size_t len, int freshness)
 {
   uint32_t sequence = getNextSeq(prefix, session);
-  ostringstream contentNameWithSeqno;
-  contentNameWithSeqno << prefix << "/" << session << "/" << sequence;
+  ostringstream sessionStream;
+  ostringstream seqStream;
+  sessionStream <<  session;
+  seqStream << sequence;
   
-  Name dataName(contentNameWithSeqno.str ());
+  Name dataName = prefix;
+  dataName.append(sessionStream.str()).append(seqStream.str());
+  
   Name signingIdentity = m_policy->inferSigningIdentity(dataName);
 
-  shared_ptr<Data> data = make_shared<Data>(dataName);
-  data->setContent(reinterpret_cast<const uint8_t*>(buf), len);
+  Data data(dataName);
+  data.setContent(reinterpret_cast<const uint8_t*>(buf), len);
 
-  Name certificateName = m_keyChain->getDefaultCertificateNameForIdentity(signingIdentity);
-  m_keyChain->sign(*data, certificateName);
+  m_keyChain->signByIdentity(data, signingIdentity);
   
-  m_face->put(*data);
+  m_face->put(data);
   
   SeqNo s(session, sequence + 1);
   m_sequenceLog[prefix] = s;
@@ -77,47 +80,51 @@
 }
 
 void 
-SyncSocket::fetchData(const string &prefix, const SeqNo &seq, const OnVerified& onVerified, int retry)
+SyncSocket::fetchData(const Name &prefix, const SeqNo &seq, const OnVerified& onVerified, int retry)
 {
-  ostringstream interestName;
-  interestName << prefix << "/" << seq.getSession() << "/" << seq.getSeq();
-  //std::cout << "Socket " << this << " Send Interest <" << interestName.str() << "> for raw data " << endl;
+  ostringstream sessionStream;
+  ostringstream seqStream;
+  sessionStream << seq.getSession();
+  seqStream << seq.getSeq();
 
-  const OnVerifyFailed& onVerifyFailed = bind(&SyncSocket::onChatDataVerifyFailed, this, _1);
+  Name interestName = prefix;
+  interestName.append(sessionStream.str()).append(seqStream.str());
+
+  const OnVerifyFailed& onVerifyFailed = bind(&SyncSocket::onDataVerifyFailed, this, _1);
   
   
-  shared_ptr<ndn::Interest> interest = make_shared<ndn::Interest>(interestName.str());
-  m_face->expressInterest(*interest, 
-                          bind(&SyncSocket::onChatData, this, _1, _2, onVerified, onVerifyFailed), 
-                          bind(&SyncSocket::onChatDataTimeout, this, _1, retry, onVerified, onVerifyFailed));
+  ndn::Interest interest(interestName);
+  m_face->expressInterest(interest, 
+                          bind(&SyncSocket::onData, this, _1, _2, onVerified, onVerifyFailed), 
+                          bind(&SyncSocket::onDataTimeout, this, _1, retry, onVerified, onVerifyFailed));
 
 }
 
 void
-SyncSocket::onChatData(const shared_ptr<const ndn::Interest>& interest, 
-                       const shared_ptr<Data>& data,
-                       const OnVerified& onVerified,
-                       const OnVerifyFailed& onVerifyFailed)
+SyncSocket::onData(const shared_ptr<const ndn::Interest>& interest, 
+                   const shared_ptr<Data>& data,
+                   const OnVerified& onVerified,
+                   const OnVerifyFailed& onVerifyFailed)
 {
   m_verifier->verifyData(data, onVerified, onVerifyFailed);
 }
 
 void
-SyncSocket::onChatDataTimeout(const shared_ptr<const ndn::Interest>& interest, 
-                              int retry,
-                              const OnVerified& onVerified,
-                              const OnVerifyFailed& onVerifyFailed)
+SyncSocket::onDataTimeout(const shared_ptr<const ndn::Interest>& interest, 
+                          int retry,
+                          const OnVerified& onVerified,
+                          const OnVerifyFailed& onVerifyFailed)
 {
   if(retry > 0)
     {
       m_face->expressInterest(*interest,
-                              bind(&SyncSocket::onChatData,
+                              bind(&SyncSocket::onData,
                                    this,
                                    _1,
                                    _2,
                                    onVerified,
                                    onVerifyFailed),
-                              bind(&SyncSocket::onChatDataTimeout, 
+                              bind(&SyncSocket::onDataTimeout, 
                                    this,
                                    _1,
                                    retry - 1,
@@ -126,18 +133,18 @@
                               
     }
   else
-    _LOG_DEBUG("Chat interest eventually time out!");
+    _LOG_DEBUG("interest eventually time out!");
 }
 
 void
-SyncSocket::onChatDataVerifyFailed(const shared_ptr<Data>& data)
+SyncSocket::onDataVerifyFailed(const shared_ptr<Data>& data)
 {
-  _LOG_DEBUG("Chat data cannot be verified!");
+  _LOG_DEBUG("data cannot be verified!");
 }
 
 
 uint32_t
-SyncSocket::getNextSeq (const string &prefix, uint32_t session)
+SyncSocket::getNextSeq (const Name &prefix, uint32_t session)
 {
   SequenceLog::iterator i = m_sequenceLog.find (prefix);
 
diff --git a/src/sync-socket.h b/src/sync-socket.h
index e34857d..b558ff9 100644
--- a/src/sync-socket.h
+++ b/src/sync-socket.h
@@ -23,7 +23,6 @@
 
 #include "sync-logic.h"
 #include <boost/function.hpp>
-#include <boost/unordered_map.hpp>
 #include "sync-seq-no.h"
 #include <ndn-cpp-dev/face.hpp>
 #include <ndn-cpp-dev/security/verifier.hpp>
@@ -64,21 +63,21 @@
   ~SyncSocket ();
 
   bool 
-  publishData(const std::string &prefix, uint32_t session, const char *buf, size_t len, int freshness);
+  publishData(const ndn::Name &prefix, uint32_t session, const char *buf, size_t len, int freshness);
 
   void 
-  remove (const std::string &prefix) 
+  remove (const ndn::Name &prefix) 
   { m_syncLogic.remove(prefix); }
 
   void 
-  fetchData(const std::string &prefix, const SeqNo &seq, const ndn::OnVerified& onVerified, int retry = 0);
+  fetchData(const ndn::Name &prefix, const SeqNo &seq, const ndn::OnVerified& onVerified, int retry = 0);
 
   std::string 
   getRootDigest() 
   { return m_syncLogic.getRootDigest(); }
 
   uint32_t
-  getNextSeq (const std::string &prefix, uint32_t session);
+  getNextSeq (const ndn::Name &prefix, uint32_t session);
 
   SyncLogic &
   getLogic () 
@@ -95,22 +94,22 @@
   { m_newDataCallback(v, this); }
 
   void
-  onChatData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
+  onData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
              const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
              const ndn::OnVerified& onVerified,
              const ndn::OnVerifyFailed& onVerifyFailed);
 
   void
-  onChatDataTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
+  onDataTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                     int retry,
                     const ndn::OnVerified& onVerified,
                     const ndn::OnVerifyFailed& onVerifyFailed);
 
   void
-  onChatDataVerifyFailed(const ndn::ptr_lib::shared_ptr<ndn::Data>& data);
+  onDataVerifyFailed(const ndn::ptr_lib::shared_ptr<ndn::Data>& data);
 
 private:
-  typedef boost::unordered_map<std::string, SeqNo> SequenceLog;
+  typedef std::map<ndn::Name, SeqNo> SequenceLog;
   NewDataCallback m_newDataCallback;
   SequenceLog m_sequenceLog;
   ndn::ptr_lib::shared_ptr<SecPolicySync> m_policy;
