diff --git a/model/sync-ccnx-wrapper.cc b/model/sync-ccnx-wrapper.cc
index a7936a3..88c65d9 100644
--- a/model/sync-ccnx-wrapper.cc
+++ b/model/sync-ccnx-wrapper.cc
@@ -108,7 +108,7 @@
   }
 }
 
-int CcnxWrapper::publishData(string name, shared_ptr< DataBuffer > dataBuffer, int freshness)
+int CcnxWrapper::publishData(string name, string dataBuffer, int freshness)
 {
   ccn_charbuf *pname = ccn_charbuf_create();
   ccn_charbuf *signed_info = ccn_charbuf_create();
@@ -124,7 +124,7 @@
 			 NULL,
 			 m_keyLoactor);
   ccn_encode_ContentObject(content, pname, signed_info,
-			   dataBuffer->buffer(), dataBuffer->length(),
+			   dataBuffer.c_str(), dataBuffer.length(),
 			   NULL, getPrivateKey());
   ccn_put(m_handle, content->buf, content->length);
 
@@ -154,10 +154,16 @@
       return CCN_UPCALL_RESULT_OK;
   }
 
-  char *comp;
-  size_t size;
-  ccn_name_comp_get(info->content_ccnb, info->content_comps, info->content_comps->n - 3, (const unsigned char **)&comp, &size);
-  f((string)comp);
+  string interest;
+  for (int i = 0; i < info->content_comps->n - 1; i++)
+  {
+    char *comp;
+    size_t size;
+    ccn_name_comp_get(info->content_ccnb, info->content_comps, i, (const unsigned char **)&comp, &size);
+    interest += comp;
+  }
+  f(interest);
+  return CCN_UPCALL_RESULT_OK;
 }
 
 static ccn_upcall_res incomingData(
@@ -165,7 +171,7 @@
   ccn_upcall_kind kind,
   ccn_upcall_info *info)
 {
-  function<void (shared_ptr<DataBuffer>)> f = *(function<void (shared_ptr<DataBuffer>)> *)selfp->data;
+  function<void (string)> f = *(function<void (string)> *)selfp->data;
 
   switch (kind)
   {
@@ -183,15 +189,14 @@
   char *pcontent;
   size_t len;
   ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E], info->pco, (const unsigned char **)&pcontent, &len);
-  shared_ptr<DataBuffer> data(new DataBufferImpl((const unsigned char*)pcontent, len));
-  f(data);
+  f((string)pcontent);
 }
 
-int CcnxWrapper::sendInterest(string strInterest, function< void (shared_ptr< DataBuffer >) > dataCallback)
+int CcnxWrapper::sendInterest(string strInterest, function<void (string)> dataCallback)
 {
   ccn_charbuf *pname = ccn_charbuf_create();
   ccn_closure *dataClosure = new ccn_closure;
-  function<void (shared_ptr< DataBuffer >)> *f = new function<void (shared_ptr< DataBuffer >)>(dataCallback);
+  function<void (string)> *f = new function<void (string)>(dataCallback);
 
   ccn_name_from_uri(pname, strInterest.c_str());
   ccn_express_interest(m_handle, pname, dataClosure, NULL);
@@ -201,7 +206,7 @@
   ccn_charbuf_destroy(&pname);
 }
 
-int CcnxWrapper::setInterestFilter(string prefix, function< void (string) > interestCallback)
+int CcnxWrapper::setInterestFilter(string prefix, function<void (string)> interestCallback)
 {
   ccn_charbuf *pname = ccn_charbuf_create();
   ccn_closure *interestClosure = new ccn_closure;
diff --git a/model/sync-ccnx-wrapper.h b/model/sync-ccnx-wrapper.h
index fa1356b..037d2d2 100644
--- a/model/sync-ccnx-wrapper.h
+++ b/model/sync-ccnx-wrapper.h
@@ -36,7 +36,7 @@
 #include <boost/thread/thread.hpp>
 #include <boost/function.hpp>
 #include <string>
-#include "sync-data-buffer.h"
+
 /**
  * \defgroup sync SYNC protocol
  *
@@ -84,8 +84,8 @@
    * @param dataCallback the callback function to deal with the returned data
    * @return the return code of ccn_express_interest
    */
-   int sendInterest(std::string strInterest, boost::function<void
-   (boost::shared_ptr<DataBuffer>)> dataCallback);
+   int sendInterest(std::string strInterest, boost::function<void (std::string)>
+   dataCallback);
 
   /**
    * @brief set Interest filter (specify what interest you want to receive
@@ -106,8 +106,7 @@
    * @param freshness the freshness time for the data object
    * @return code generated by ccnx library calls, >0 if success
    */
-   int publishData(std::string name, boost::shared_ptr<DataBuffer> dataBuffer,
-   int freshness);
+   int publishData(std::string name, std::string dataBuffer, int freshness);
 
 };
 
diff --git a/model/sync-data-buffer.cc b/model/sync-data-buffer.cc
deleted file mode 100644
index 2680859..0000000
--- a/model/sync-data-buffer.cc
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
diff --git a/model/sync-data-buffer.h b/model/sync-data-buffer.h
deleted file mode 100644
index 8706188..0000000
--- a/model/sync-data-buffer.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SYNC_DATA_BUFFER_H
-#define SYNC_DATA_BUFFER_H
-
-#include <tinyxml.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/exception/all.hpp>
-#include "sync-diff-state.h"
-#include "sync-full-state.h"
-
-
-/**
- * \defgroup sync SYNC protocol
- *
- * Implementation of SYNC protocol
- */
-namespace Sync {
-
-/**
- * \ingroup sync
- * @brief DataBuffer Interface to be used by CcnxWrapper and all other data
- * publish/request/processing related functions
- */
-class DataBuffer {
-public:
-	virtual ~DataBuffer() = 0;
-	virtual size_t length() = 0;
-	virtual const unsigned char *buffer() = 0;
-	virtual void setBufferAndLength(const unsigned char *buffer, size_t len) =
-	0;
-};
-
-/**
- * \ingroup sync
- * @brief general Data Buffer class, implments DataBuffer interface mainly works for app data
- */
-class DataBufferImpl : public DataBuffer {
-public:
-	DataBufferImpl() {m_buffer = NULL; m_len = 0;}
-	DataBufferImpl(const unsigned char *buffer, size_t len);
-	DataBufferImpl(const DataBuffer *DataBuffer);
-	DataBufferImpl &operator=(const DataBuffer *DataBuffer);
-
-	/**
-	 * @brief reset the buffer and len
-	 */
-	virtual void setBufferAndLength(const unsigned char *buffer, size_t len);
-	virtual ~DataBufferImpl();
-	virtual size_t length() {return m_len;}
-	virtual const unsigned char *buffer() { return const_cast<const unsigned
-	char *> (m_buffer); }
-
-private:
-	unsigned char *m_buffer;
-	size_t m_len;
-};
-
-
-
-/**
- * \ingroup sync
- * @brief decorator class, wrapper for sync data; converts to and from states
- */
-class SyncDataBuffer : DataBuffer{
-public:
-	/**
-	 * @brief decorates some object that implements DataBuffer interface
-	 * primary usage here is to decorate AppDataBuffer
-	 */
-	SyncDataBuffer(boost::shared_ptr<DataBuffer> dataBuffer) { m_dataBuffer = dataBuffer;}
-	virtual ~SyncDataBuffer(){};
-	virtual size_t length() {m_dataBuffer->length();}
-	virtual const unsigned char *buffer() {m_dataBuffer->buffer();}
-	virtual void setBufferAndLength(const unsigned char *buffer, size_t len)
-	{m_dataBuffer->setBufferAndLength(buffer, len); }
-
-	/**
-	 * @brief convert from FullState to SyncDataBuffer
-	 */
-	SyncDataBuffer &operator<<(FullState &fs);
-
-	/**
-	 * @brief convert from DiffState to SyncDataBuffer
-	 */
-	SyncDataBuffer &operator<<(DiffState &ds);
-
-	/**
-	 * @brief convert from SyncDataBuffer to FullState, throws
-	 * SyncDataBufferConvertException if convert fails
-	 */
-	SyncDataBuffer &operator>>(FullState &fs);
-
-	/**
-	 * @brief convert from SyncDataBuffer to DiffState, throws
-	 * SyncDataBufferConvertException if convert fails
-	 */
-	SyncDataBuffer &operator>>(DiffState &ds);
-
-private:
-	boost::shared_ptr<DataBuffer> m_dataBuffer;
-};
-
-struct SyncDataBufferConvertException : virtual boost::exception {};
-
-} // Sync
-
-#endif // SYNC_DATA_BUFFER_H
