diff --git a/model/sync-app-data-fetch.cc b/model/sync-app-data-fetch.cc
index 76b6119..43e089b 100644
--- a/model/sync-app-data-fetch.cc
+++ b/model/sync-app-data-fetch.cc
@@ -28,16 +28,17 @@
 namespace Sync
 {
 
-void AppDataFetch::fetch(string prefix, uint32_t startSeq, uint32_t endSeq)
+void
+AppDataFetch::fetch (const string &prefix, uint32_t startSeq, uint32_t endSeq)
 {
   for (uint32_t i = startSeq; i <= endSeq; i++)
   {
     if (i == 0)
       continue;
-    string interestName = prefix;
-    interestName += i;
-    m_ccnxHandle->sendInterest(interestName, m_dataCallback);
+    ostringstream interestName;
+    interestName << prefix << "/" << i;
+    m_ccnxHandle->sendInterest (interestName.str (), m_dataCallback);
   }
 }
 
-}
\ No newline at end of file
+}
diff --git a/model/sync-app-data-fetch.h b/model/sync-app-data-fetch.h
index ae07679..3f368cb 100644
--- a/model/sync-app-data-fetch.h
+++ b/model/sync-app-data-fetch.h
@@ -22,9 +22,8 @@
 
 #ifndef SYNC_APP_DATA_FETCH_H
 #define SYNC_APP_DATA_FETCH_H
+
 #include "sync-ccnx-wrapper.h"
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
 
 namespace Sync {
 
@@ -36,28 +35,40 @@
 class AppDataFetch
 {
 public:
-	/**
-	 * @param dataCallback the callback function to process data
-	 */
-	AppDataFetch(boost::shared_ptr<CcnxWrapper> ccnxHandle,
-		     boost::function<void (std::string, std::string)> dataCallback)
-	{ m_ccnxHandle = ccnxHandle; m_dataCallback = dataCallback; }
+  /**
+   * @brief Constructor
+   * @param ccnxHandle handle for CCNx
+   * @param dataCallback the callback function to process data
+   */
+  AppDataFetch (CcnxWrapperPtr ccnxHandle,
+                CcnxWrapper::DataCallback dataCallback)
+    : m_ccnxHandle (ccnxHandle)
+    , m_dataCallback (dataCallback)
+  { }
 
-	void setDataCallback(boost::function<void (std::string, std::string)> dataCallback)
-	{ m_dataCallback = dataCallback; }
+  /**
+   * @brief Set data callback
+   * @param dataCallback the callback function to process data
+   */
+  void
+  setDataCallback(CcnxWrapper::DataCallback dataCallback)
+  {
+    m_dataCallback = dataCallback;
+  }
 
-	/**
-	 * @brief fetch data for a certain name prefix
-	 *
-	 * @param prefix the prefix for the data
-	 * @param startSeq the start of sequence number range (inclusive)
-	 * @param endSeq the end of sequence number range (inclusive)
-	 */
-	void fetch(std::string prefix, uint32_t startSeq, uint32_t endSeq);
+  /**
+   * @brief Fetch data for a certain name prefix
+   *
+   * @param prefix the prefix for the data
+   * @param startSeq the start of sequence number range (inclusive)
+   * @param endSeq the end of sequence number range (inclusive)
+   */
+  void
+  fetch (const std::string &prefix, uint32_t startSeq, uint32_t endSeq);
 
 private:
-	boost::shared_ptr<CcnxWrapper> m_ccnxHandle;
-	boost::function<void (std::string, std::string)> m_dataCallback;
+  CcnxWrapperPtr m_ccnxHandle;
+  CcnxWrapper::DataCallback m_dataCallback;
 };
 
 
diff --git a/model/sync-app-data-publish.cc b/model/sync-app-data-publish.cc
index d05bcbe..77b9160 100644
--- a/model/sync-app-data-publish.cc
+++ b/model/sync-app-data-publish.cc
@@ -28,26 +28,29 @@
 namespace Sync
 {
 
-string AppDataPublish::getRecentData(string prefix, uint32_t session)
+string
+AppDataPublish::getRecentData (const string &prefix, uint32_t session)
 {
-
+  return "";
 }
 
-uint32_t AppDataPublish::getHighestSeq(string prefix, uint32_t session)
+uint32_t
+AppDataPublish::getHighestSeq (const string &prefix, uint32_t session)
 {
   unordered_map<string, Seq>::iterator i = m_sequenceLog.find(prefix);
 
   if (i != m_sequenceLog.end())
-  {
-    Seq s = i->second;
-    if (s.session == session)
-      return s.seq;
-  }
+    {
+      Seq s = i->second;
+      if (s.session == session)
+        return s.seq;
+    }
 
   return 0;
 }
 
-bool AppDataPublish::publishData(string name, uint32_t session, string dataBuffer, int freshness)
+bool
+AppDataPublish::publishData (const string &name, uint32_t session, const string &dataBuffer, int freshness)
 {
   uint32_t seq = getHighestSeq(name, session);
   if (seq == 0)
@@ -61,12 +64,12 @@
   s.seq = seq;
   m_sequenceLog[name] = s;
 
-  string contentName = name;
-  contentName += seq;
+  ostringstream contentNameWithSeqno;
+  contentNameWithSeqno << name << "/" << seq;
 
-  m_ccnxHandle->publishData(contentName, dataBuffer, freshness);
+  m_ccnxHandle->publishData (contentNameWithSeqno.str (), dataBuffer, freshness);
 
   return true;
 }
 
-}
\ No newline at end of file
+}
diff --git a/model/sync-app-data-publish.h b/model/sync-app-data-publish.h
index 1082904..d00588a 100644
--- a/model/sync-app-data-publish.h
+++ b/model/sync-app-data-publish.h
@@ -22,16 +22,11 @@
 
 #ifndef SYNC_APP_DATA_PUBLISH_H
 #define SYNC_APP_DATA_PUBLISH_H
-#include <boost/shared_ptr.hpp>
+
 #include <boost/unordered_map.hpp>
 #include "sync-seq-no.h"
 #include "sync-ccnx-wrapper.h"
 
-/**
- * \defgroup sync SYNC protocol
- *
- * Implementation of SYNC protocol
- */
 namespace Sync {
 
 struct Seq
@@ -49,39 +44,45 @@
 class AppDataPublish
 {
 public:
-	AppDataPublish(boost::shared_ptr<CcnxWrapper> ccnxHandle)
-	{ m_ccnxHandle = ccnxHandle; }
-	~AppDataPublish() {};
+  AppDataPublish (CcnxWrapperPtr ccnxHandle)
+  : m_ccnxHandle (ccnxHandle)
+  { }
 
-	/**
-	 * @brief get the name (including sequence number) and the content
-	 * (unencoded, just XML stanza) of the most recent published data
-	 *
-	 * @param prefix the name prefix to look for
-	 * @return the pair of name and content
-	 */
-	std::string getRecentData(std::string prefix, uint32_t session);
+  /**
+   * @brief get the name (including sequence number) and the content
+   * (unencoded, just XML stanza) of the most recent published data
+   *
+   * @param prefix the name prefix to look for
+   * @param session session
+   * @return the pair of name and content
+   */
+  std::string
+  getRecentData (const std::string &prefix, uint32_t session);
 
-	/**
-	 * brief get the most recent sequence number for a name prefix
-	 */
-	 u_int32_t getHighestSeq(std::string prefix, uint32_t session);
+  /**
+   * @brief get the most recent sequence number for a name prefix
+   * @param prefix the name prefix to look for
+   * @param session session
+   */
+  uint32_t
+  getHighestSeq (const std::string &prefix, uint32_t session);
 
-	/**
-	 * @brief publish data for a name prefix, updates the corresponding
-	 * sequence number and recent data
-	 *
-	 * @param name data prefix
-	 * @param dataBuffer the data itself
-	 * @param freshness the freshness for the data object
-	 * @return whether the publish succeeded
-	 */
-	bool publishData(std::string name, uint32_t session, std::string dataBuffer, int freshness);
+  /**
+   * @brief publish data for a name prefix, updates the corresponding
+   * sequence number and recent data
+   *
+   * @param name data prefix
+   * @param session session to which data is published
+   * @param dataBuffer the data itself
+   * @param freshness the freshness for the data object
+   * @return whether the publish succeeded
+   */
+  bool publishData (const std::string &name, uint32_t session, const std::string &dataBuffer, int freshness);
 
 private:
-	boost::unordered_map<std::string, Seq> m_sequenceLog;
-	boost::shared_ptr<CcnxWrapper> m_ccnxHandle;
-	boost::unordered_map<std::string, std::string> m_recentData;
+  boost::unordered_map<std::string, Seq> m_sequenceLog;
+  CcnxWrapperPtr m_ccnxHandle;
+  boost::unordered_map<std::string, std::string> m_recentData;
 };
 
 } // Sync
diff --git a/model/sync-app-socket.cc b/model/sync-app-socket.cc
index c349aeb..d703e76 100644
--- a/model/sync-app-socket.cc
+++ b/model/sync-app-socket.cc
@@ -28,27 +28,24 @@
 namespace Sync
 {
 
-SyncAppSocket::SyncAppSocket(string syncPrefix, function<void (string, string)> dataCallback)
+SyncAppSocket::SyncAppSocket (const string &syncPrefix, CcnxWrapper::DataCallback dataCallback)
+  : m_ccnxHandle (new CcnxWrapper())
+  , m_fetcher (m_ccnxHandle, dataCallback)
+  , m_publisher (m_ccnxHandle)
+  , m_syncLogic (syncPrefix,
+                 bind (&AppDataFetch::fetch, m_fetcher, _1, _2, _3),
+                 m_ccnxHandle)
 {
-  m_ccnxHandle.reset(new CcnxWrapper());
-  m_fetcher = new AppDataFetch(m_ccnxHandle, dataCallback);
-  m_publisher = new AppDataPublish(m_ccnxHandle);
-
-  function<void (string, uint32_t, uint32_t)> f(bind(&AppDataFetch::fetch, m_fetcher, _1, _2, _3));
-  m_syncLogic = new SyncLogic(syncPrefix, f, m_ccnxHandle);
 }
 
 SyncAppSocket::~SyncAppSocket()
 {
-  delete m_syncLogic;
-  delete m_fetcher;
-  delete m_publisher;
 }
 
-bool SyncAppSocket::publish(string prefix, uint32_t session, string dataBuffer, int freshness)
+bool SyncAppSocket::publish (const string &prefix, uint32_t session, const string &dataBuffer, int freshness)
 {
-  m_publisher->publishData(prefix, session, dataBuffer, freshness);
-  m_syncLogic->addLocalNames(prefix, session, m_publisher->getHighestSeq(prefix, session));
+  m_publisher.publishData (prefix, session, dataBuffer, freshness);
+  m_syncLogic.addLocalNames (prefix, session, m_publisher.getHighestSeq (prefix, session));
 }
 
-}
\ No newline at end of file
+}
diff --git a/model/sync-app-socket.h b/model/sync-app-socket.h
index 3b2c62c..38a2657 100644
--- a/model/sync-app-socket.h
+++ b/model/sync-app-socket.h
@@ -37,37 +37,37 @@
 class SyncAppSocket
 {
 public:
-	/**
-	 * @brief the constructor for SyncAppSocket; the parameter syncPrefix
-	 * should be passed to the constructor of m_syncAppWrapper; the other
-	 * parameter should be passed to the constructor of m_fetcher; furthermore,
-	 * the fetch function of m_fetcher should be a second paramter passed to
-	 * the constructor of m_syncAppWrapper, so that m_syncAppWrapper can tell
-	 * m_fetcher to fetch the actual app data after it learns the names
-	 *
-	 * @param syncPrefix the name prefix for Sync Interest
-	 * @param dataCallback the callback to process data
-	 */
-	SyncAppSocket(std::string syncPrefix, boost::function<void (std::string, std::string)>
-	dataCallback);
+  /**
+   * @brief the constructor for SyncAppSocket; the parameter syncPrefix
+   * should be passed to the constructor of m_syncAppWrapper; the other
+   * parameter should be passed to the constructor of m_fetcher; furthermore,
+   * the fetch function of m_fetcher should be a second paramter passed to
+   * the constructor of m_syncAppWrapper, so that m_syncAppWrapper can tell
+   * m_fetcher to fetch the actual app data after it learns the names
+   *
+   * @param syncPrefix the name prefix for Sync Interest
+   * @param dataCallback the callback to process data
+   */
+  SyncAppSocket (const std::string &syncPrefix, CcnxWrapper::DataCallback dataCallback);
+  ~SyncAppSocket ();
 
-	~SyncAppSocket();
-
-	/**
-	 * @brief publish data from local client and tell SyncLogic to update
-	 * the sync tree by adding the local names
-	 *
-	 * @param prefix the name prefix for the data
-	 * @param dataBuffer the data itself
-	 * @param freshness the freshness time for the data (in seconds)
-	 */
-	bool publish(std::string prefix, uint32_t session, std::string dataBuffer, int freshness);
+  /**
+   * @brief publish data from local client and tell SyncLogic to update
+   * the sync tree by adding the local names
+   *
+   * @param prefix the name prefix for the data
+   * @param session session to which data is published
+   * @param dataBuffer the data itself
+   * @param freshness the freshness time for the data (in seconds)
+   */
+  bool publish (const std::string &prefix, uint32_t session, const std::string &dataBuffer, int freshness);
 
 private:
-	AppDataFetch *m_fetcher;
-	AppDataPublish *m_publisher;
-	SyncLogic *m_syncLogic;
-	boost::shared_ptr<CcnxWrapper> m_ccnxHandle;
+  CcnxWrapperPtr m_ccnxHandle;
+
+  AppDataFetch   m_fetcher;
+  AppDataPublish m_publisher;
+  SyncLogic      m_syncLogic;
 };
 
 } // Sync
diff --git a/model/sync-ccnx-wrapper.cc b/model/sync-ccnx-wrapper.cc
index 0acde7f..b901a43 100644
--- a/model/sync-ccnx-wrapper.cc
+++ b/model/sync-ccnx-wrapper.cc
@@ -45,50 +45,58 @@
 {
   m_running = false;
   m_thread.join();
-  ccn_disconnect(m_handle);
-  ccn_destroy(&m_handle);
-  ccn_charbuf_destroy(&m_keyLoactor);
-  ccn_keystore_destroy(&m_keyStore);
+  ccn_disconnect (m_handle);
+  ccn_destroy (&m_handle);
+  ccn_charbuf_destroy (&m_keyLoactor);
+  ccn_keystore_destroy (&m_keyStore);
 }
 
-void CcnxWrapper::createKeyLocator()
+/// @cond include_hidden
+
+void
+CcnxWrapper::createKeyLocator ()
 {
   m_keyLoactor = ccn_charbuf_create();
-  ccn_charbuf_append_tt(m_keyLoactor, CCN_DTAG_KeyLocator, CCN_DTAG);
-  ccn_charbuf_append_tt(m_keyLoactor, CCN_DTAG_Key, CCN_DTAG);
-  int res = ccn_append_pubkey_blob(m_keyLoactor, ccn_keystore_public_key(m_keyStore));
+  ccn_charbuf_append_tt (m_keyLoactor, CCN_DTAG_KeyLocator, CCN_DTAG);
+  ccn_charbuf_append_tt (m_keyLoactor, CCN_DTAG_Key, CCN_DTAG);
+  int res = ccn_append_pubkey_blob (m_keyLoactor, ccn_keystore_public_key(m_keyStore));
   if (res >= 0)
     {
-      ccn_charbuf_append_closer(m_keyLoactor); /* </Key> */
-      ccn_charbuf_append_closer(m_keyLoactor); /* </KeyLocator> */
+      ccn_charbuf_append_closer (m_keyLoactor); /* </Key> */
+      ccn_charbuf_append_closer (m_keyLoactor); /* </KeyLocator> */
     }
 }
 
-const ccn_pkey* CcnxWrapper::getPrivateKey()
+const ccn_pkey*
+CcnxWrapper::getPrivateKey ()
 {
-  return ccn_keystore_private_key(m_keyStore);
+  return ccn_keystore_private_key (m_keyStore);
 }
 
-const unsigned char* CcnxWrapper::getPublicKeyDigest()
+const unsigned char*
+CcnxWrapper::getPublicKeyDigest ()
 {
   return ccn_keystore_public_key_digest(m_keyStore);
 }
 
-ssize_t CcnxWrapper::getPublicKeyDigestLength()
+ssize_t
+CcnxWrapper::getPublicKeyDigestLength ()
 {
   return ccn_keystore_public_key_digest_length(m_keyStore);
 }
 
-void CcnxWrapper::initKeyStore()
+void
+CcnxWrapper::initKeyStore ()
 {
-  ccn_charbuf *temp = ccn_charbuf_create();
-  m_keyStore = ccn_keystore_create();
-  ccn_charbuf_putf(temp, "%s/.ccnx/.ccnx_keystore", getenv("HOME"));
-  ccn_keystore_init(m_keyStore, ccn_charbuf_as_string(temp), (char*)"Th1s1sn0t8g00dp8ssw0rd.");
-  ccn_charbuf_destroy(&temp);
+  ccn_charbuf *temp = ccn_charbuf_create ();
+  m_keyStore = ccn_keystore_create ();
+  ccn_charbuf_putf (temp, "%s/.ccnx/.ccnx_keystore", getenv("HOME"));
+  ccn_keystore_init (m_keyStore, ccn_charbuf_as_string(temp), (char*)"Th1s1sn0t8g00dp8ssw0rd.");
+  ccn_charbuf_destroy (&temp);
 }
 
-void CcnxWrapper::ccnLoop()
+void
+CcnxWrapper::ccnLoop ()
 {
   pollfd pfds[1];
   int res = ccn_run(m_handle, 0);
@@ -110,7 +118,10 @@
     }
 }
 
-int CcnxWrapper::publishData(string name, string dataBuffer, int freshness)
+/// @endcond
+
+int
+CcnxWrapper::publishData (const string &name, const string &dataBuffer, int freshness)
 {
   ccn_charbuf *pname = ccn_charbuf_create();
   ccn_charbuf *signed_info = ccn_charbuf_create();
@@ -126,27 +137,28 @@
 			 NULL,
 			 m_keyLoactor);
   ccn_encode_ContentObject(content, pname, signed_info,
-			   dataBuffer.c_str(), dataBuffer.length(),
+			   dataBuffer.c_str(), dataBuffer.length (),
 			   NULL, getPrivateKey());
   recursive_mutex::scoped_lock lock(m_mutex);
   ccn_put(m_handle, content->buf, content->length);
 
-  ccn_charbuf_destroy(&pname);
-  ccn_charbuf_destroy(&signed_info);
-  ccn_charbuf_destroy(&content);
+  ccn_charbuf_destroy (&pname);
+  ccn_charbuf_destroy (&signed_info);
+  ccn_charbuf_destroy (&content);
 }
 
 
-static ccn_upcall_res incomingInterest(
-                                       ccn_closure *selfp,
-                                       ccn_upcall_kind kind,
-                                       ccn_upcall_info *info)
+static ccn_upcall_res
+incomingInterest(ccn_closure *selfp,
+                 ccn_upcall_kind kind,
+                 ccn_upcall_info *info)
 {
-  function<void (string)> f = *(function<void (string)> *)selfp->data;
+  CcnxWrapper::InterestCallback *f = static_cast<CcnxWrapper::InterestCallback*> (selfp->data);
 
   switch (kind)
     {
     case CCN_UPCALL_FINAL:
+      delete f;
       delete selfp;
       return CCN_UPCALL_RESULT_OK;
 
@@ -166,20 +178,21 @@
       ccn_name_comp_get(info->interest_ccnb, info->interest_comps, i, (const unsigned char **)&comp, &size);
       interest += comp;
     }
-  f(interest);
+  (*f) (interest);
   return CCN_UPCALL_RESULT_OK;
 }
 
-static ccn_upcall_res incomingData(
-                                   ccn_closure *selfp,
-                                   ccn_upcall_kind kind,
-                                   ccn_upcall_info *info)
+static ccn_upcall_res
+incomingData(ccn_closure *selfp,
+             ccn_upcall_kind kind,
+             ccn_upcall_info *info)
 {
-  function<void (string, string)> f = *(function<void (string, string)> *)selfp->data;
+  CcnxWrapper::DataCallback *f = static_cast<CcnxWrapper::DataCallback*> (selfp->data);
 
   switch (kind)
     {
     case CCN_UPCALL_FINAL:
+      delete f; // this never called in unit tests... 
       delete selfp;
       return CCN_UPCALL_RESULT_OK;
 
@@ -203,35 +216,34 @@
       name += comp; // this will also crash if name doesn't have \0 ending
     }
   // this will crash when content doesn't have \0 ending
-  f(name, (string)pcontent);
+  (*f) (name, (string)pcontent);
   return CCN_UPCALL_RESULT_OK;
 }
 
-int CcnxWrapper::sendInterest(string strInterest, function<void (string, string)> dataCallback)
+int CcnxWrapper::sendInterest (const string &strInterest, const DataCallback &dataCallback)
 {
   ccn_charbuf *pname = ccn_charbuf_create();
   ccn_closure *dataClosure = new ccn_closure;
-  function<void (string, string)> *f = new function<void (string, string)>(dataCallback);
-
-  ccn_name_from_uri(pname, strInterest.c_str());
-  dataClosure->data = f;
+  
+  ccn_name_from_uri (pname, strInterest.c_str());
+  dataClosure->data = new DataCallback (dataCallback); // should be removed when closure is removed
+  
   dataClosure->p = &incomingData;
   recursive_mutex::scoped_lock lock(m_mutex);
-  ccn_express_interest(m_handle, pname, dataClosure, NULL);
+  ccn_express_interest (m_handle, pname, dataClosure, NULL);
 
-  ccn_charbuf_destroy(&pname);
+  ccn_charbuf_destroy (&pname);
 }
 
-int CcnxWrapper::setInterestFilter(string prefix, function<void (string)> interestCallback)
+int CcnxWrapper::setInterestFilter (const string &prefix, const InterestCallback &interestCallback)
 {
   ccn_charbuf *pname = ccn_charbuf_create();
   ccn_closure *interestClosure = new ccn_closure;
-  function<void (string)> *f = new function<void (string)>(interestCallback);
 
-  ccn_name_from_uri(pname, prefix.c_str());
-  interestClosure->data = f;
+  ccn_name_from_uri (pname, prefix.c_str());
+  interestClosure->data = new InterestCallback (interestCallback); // should be removed when closure is removed
   interestClosure->p = &incomingInterest;
-  ccn_set_interest_filter(m_handle, pname, interestClosure);
+  ccn_set_interest_filter (m_handle, pname, interestClosure);
 
   ccn_charbuf_destroy(&pname);
 }
diff --git a/model/sync-ccnx-wrapper.h b/model/sync-ccnx-wrapper.h
index 00b5cd5..84893d8 100644
--- a/model/sync-ccnx-wrapper.h
+++ b/model/sync-ccnx-wrapper.h
@@ -51,7 +51,9 @@
  */
 class CcnxWrapper {
 public:
-
+  typedef boost::function<void (std::string, std::string)> DataCallback;
+  typedef boost::function<void (std::string)> InterestCallback;
+  
   /**
    * @brief initialize the wrapper; a lot of things needs to be done. 1) init
    * keystore 2) init keylocator 3) start a thread to hold a loop of ccn_run
@@ -68,8 +70,7 @@
    * @return the return code of ccn_express_interest
    */
   int
-  sendInterest(std::string strInterest, boost::function<void
-  (std::string, std::string)> dataCallback);
+  sendInterest (const std::string &strInterest, const DataCallback &dataCallback);
 
   /**
    * @brief set Interest filter (specify what interest you want to receive
@@ -79,8 +80,7 @@
    * @return the return code of ccn_set_interest_filter
    */
   int
-  setInterestFilter(std::string prefix, boost::function<void (std::string)>
-                    interestCallback);
+  setInterestFilter (const std::string &prefix, const InterestCallback &interestCallback);
 
   /**
    * @brief publish data and put it to local ccn content store; need to grab
@@ -92,7 +92,7 @@
    * @return code generated by ccnx library calls, >0 if success
    */
   int
-  publishData(std::string name, std::string dataBuffer, int freshness);
+  publishData (const std::string &name, const std::string &dataBuffer, int freshness);
 
 private:
   /// @cond include_hidden 
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index f3c6aa2..20e5411 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -29,7 +29,7 @@
 {
 
 SyncLogic::SyncLogic (const string &syncPrefix,
-                      SyncCallback fetch,
+                      LogicCallback fetch,
                       CcnxWrapperPtr ccnxHandle)
   : m_syncPrefix (syncPrefix)
   , m_fetch (fetch)
@@ -70,15 +70,11 @@
 void
 SyncLogic::sendSyncInterest ()
 {
-  function<void (string, string)> f = bind(&SyncLogic::processSyncData, this, _1, _2);
-  stringstream os;
-  os << m_syncPrefix;
-  os << "/";
-  DigestConstPtr digest = m_state.getDigest();
-  os << digest;
-  string name;
-  os >> name;
-  m_ccnxHandle->sendInterest (name, f);
+  ostringstream os;
+  os << m_syncPrefix << "/" << m_state.getDigest();
+  
+  m_ccnxHandle->sendInterest (os.str (),
+                              bind (&SyncLogic::processSyncData, this, _1, _2));
 }
 
 }
diff --git a/model/sync-logic.h b/model/sync-logic.h
index 62bf485..101a4ab 100644
--- a/model/sync-logic.h
+++ b/model/sync-logic.h
@@ -42,15 +42,16 @@
 class SyncLogic
 {
 public:
-  typedef boost::function<void (const std::string &,uint32_t, uint32_t)> SyncCallback;
+  typedef boost::function<void (const std::string &,uint32_t, uint32_t)> LogicCallback;
   
   /**
-   * @brief constructor for this class;
+   * @brief Constructor
    * @param syncPrefix the name prefix to use for the Sync Interest
    * @param fetch the fetch function, which will be called to actually fetch
+   * @param ccnxHandle ccnx handle
    * the app data when new remote names are learned
    */
-  SyncLogic (const std::string &syncPrefix, SyncCallback fetch, CcnxWrapperPtr ccnxHandle);
+  SyncLogic (const std::string &syncPrefix, LogicCallback fetch, CcnxWrapperPtr ccnxHandle);
 
   ~SyncLogic ();
   
@@ -67,6 +68,7 @@
 
   /**
    * @brief process the fetched sync data
+   * @param name name ???
    * @param dataBuffer the sync data
    */
   void processSyncData (const std::string &name, const std::string &dataBuffer);
@@ -80,7 +82,7 @@
   SyncInterestTable m_syncInterestTable;
 
   std::string m_syncPrefix;
-  SyncCallback m_fetch;
+  LogicCallback m_fetch;
   CcnxWrapperPtr m_ccnxHandle;
 };
 
diff --git a/model/sync-state.h b/model/sync-state.h
index 7c0b98e..bfe2517 100644
--- a/model/sync-state.h
+++ b/model/sync-state.h
@@ -80,11 +80,10 @@
 
 /**
  * @brief Parses an XML representation to the state
- * @param DataBuffer input data
+ * @param in input data stream
  * @param state state
+ * @returns input stream
  */
-// void
-// operator >> (const std::string &DataBuffer, State &state);
 std::istream &
 operator >> (std::istream &in, State &state);
 
