diff --git a/src/sync-socket.h b/src/sync-socket.h
index 19fac0d..8013635 100644
--- a/src/sync-socket.h
+++ b/src/sync-socket.h
@@ -49,24 +49,34 @@
   typedef ndn::function< void (const std::vector<MissingDataInfo> &, SyncSocket * ) > NewDataCallback;
   typedef ndn::function< void (const std::string &/*prefix*/ ) > RemoveCallback;
 
-  SyncSocket (const ndn::Name& syncPrefix, 
-              const ndn::Name& dataPrefix,
-              uint64_t dataSession,
-              ndn::shared_ptr<ndn::Face> face,
-              const ndn::IdentityCertificate& myCertificate,
-              ndn::shared_ptr<ndn::SecRuleRelative> dataRule,
-              NewDataCallback dataCallback, 
-              RemoveCallback rmCallback);
+  static const ndn::Name EMPTY_NAME;
 
-  ~SyncSocket ();
+  SyncSocket(const ndn::Name& syncPrefix, 
+             const ndn::Name& dataPrefix,
+             uint64_t dataSession,
+             bool withRoutingPrefix,
+             const ndn::Name& routingPrefix,
+             ndn::shared_ptr<ndn::Face> face,
+             const ndn::IdentityCertificate& myCertificate,
+             ndn::shared_ptr<ndn::SecRuleRelative> dataRule,
+             NewDataCallback dataCallback, 
+             RemoveCallback rmCallback);
+
+  ~SyncSocket();
 
   void
   publishData(const uint8_t* buf, size_t len, int freshness, bool isCert = false);
 
   void 
-  remove (const ndn::Name &prefix) 
+  leave() 
   { 
-    m_syncLogic->remove(prefix); 
+    m_syncLogic->remove(m_withRoutingPrefix ? m_routableDataPrefix : m_dataPrefix); 
+  }
+
+  void
+  remove(const ndn::Name& prefix)
+  {
+    m_syncLogic->remove(prefix);
   }
 
   void 
@@ -79,21 +89,22 @@
   }
 
   uint64_t
-  getNextSeq (const ndn::Name &prefix, uint64_t session)
+  getNextSeq()
   {
-    SequenceLog::iterator i = m_sequenceLog.find (prefix);
+    // If DNS works, we should use pure m_dataprefix rather than the one with routing prefix.
+    SequenceLog::iterator i = m_sequenceLog.find (m_withRoutingPrefix ? m_routableDataPrefix : m_dataPrefix);
     
     if (i != m_sequenceLog.end ())
       {
         SeqNo s = i->second;
-        if (s.getSession() == session)
+        if (s.getSession() == m_dataSession)
           return s.getSeq();
       }
     return 0;
   }
 
   SyncLogic &
-  getLogic () 
+  getLogic() 
   { 
     return *m_syncLogic; 
   }
@@ -142,10 +153,7 @@
   
 private:
   void
-  publishDataInternal(ndn::shared_ptr<ndn::Data> data, 
-                      const ndn::Name &prefix, 
-                      uint64_t session, 
-                      bool isCert);
+  publishDataInternal(ndn::shared_ptr<ndn::Data> data, bool isCert);
 
   void 
   passCallback(const std::vector<MissingDataInfo> &v) 
@@ -154,15 +162,11 @@
   }
 
   void
-  onData(const ndn::Interest& interest, ndn::Data& data,
-         const ndn::OnDataValidated& onValidated,
-         const ndn::OnDataValidationFailed& onValidationFailed);
+  onData(const ndn::Interest& interest, ndn::Data& data, const ndn::OnDataValidated& dataCallback);
 
   void
-  onDataTimeout(const ndn::Interest& interest, 
-                int retry,
-                const ndn::OnDataValidated& onValidated,
-                const ndn::OnDataValidationFailed& onValidationFailed);
+  onDataTimeout(const ndn::Interest& interest, int retry, const ndn::OnDataValidated& dataCallback);
+
 
   void
   onDataValidated(const ndn::shared_ptr<const ndn::Data>& data,
@@ -178,6 +182,8 @@
 
   ndn::Name m_dataPrefix;
   uint64_t m_dataSession;
+  ndn::Name m_routableDataPrefix;
+  bool m_withRoutingPrefix;
   NewDataCallback m_newDataCallback;
   SequenceLog m_sequenceLog;
   ndn::IdentityCertificate m_myCertificate;
