diff --git a/demo/chatbuf.proto b/demo/chatbuf.proto
deleted file mode 100644
index 2b7d2ac..0000000
--- a/demo/chatbuf.proto
+++ /dev/null
@@ -1,14 +0,0 @@
-package SyncDemo;
-
-message ChatMessage {
-  required string to = 1;
-  required string from = 2;
-  enum ChatMessageType {
-    CHAT = 0;
-    HELLO = 1;
-    OTHER = 2;
-  }
-  required ChatMessageType type = 3 [default = CHAT];
-  optional string data = 4;
-  optional int32 timestamp = 5;
-}
diff --git a/demo/chatdialog.cpp b/demo/chatdialog.cpp
deleted file mode 100644
index 0f6e806..0000000
--- a/demo/chatdialog.cpp
+++ /dev/null
@@ -1,397 +0,0 @@
-#include <QtGui>
-#include "chatdialog.h"
-#include "settingdialog.h"
-#include <ctime>
-#include <iostream>
-#include <QTimer>
-#include <QMetaType>
-
-#define BROADCAST_PREFIX_FOR_SYNC_DEMO "/ndn/broadcast/sync-demo"
-
-void
-ChatDialog::testDraw()
-{
-  std::string prefix[5] = {"/ndn/1", "/ndn/2", "/ndn/3", "/ndn/4", "/ndn/5"};
-  std::string nick[5] = {"tom", "jerry", "jason", "michael", "hurry"};
-  std::vector<Sync::MissingDataInfo> v;
-  for (int i = 0; i < 5; i++)
-  {
-    Sync::MissingDataInfo mdi = {prefix[i], Sync::SeqNo(0), Sync::SeqNo(i * (2 << i) )};
-    v.push_back(mdi);
-  }
-
-  m_scene->processUpdate(v, "12341234@!#%!@");
-
-  for (int i = 0; i < 5; i++)
-  {
-   m_scene-> msgReceived(prefix[i].c_str(), nick[i].c_str());
-  }
-
-  fitView();
-}
-
-ChatDialog::ChatDialog(QWidget *parent)
-  : QDialog(parent), m_sock(NULL)
-{
-  // have to register this, otherwise
-  // the signal-slot system won't recognize this type
-  qRegisterMetaType<std::vector<Sync::MissingDataInfo> >("std::vector<Sync::MissingDataInfo>");
-  qRegisterMetaType<size_t>("size_t");
-  setupUi(this);
-  m_session = time(NULL);
-
-  readSettings();
-
-  updateLabels();
-
-  lineEdit->setFocusPolicy(Qt::StrongFocus);
-  m_scene = new DigestTreeScene(this);
-
-  treeViewer->setScene(m_scene);
-  m_scene->plot("Empty");
-  QRectF rect = m_scene->itemsBoundingRect();
-  m_scene->setSceneRect(rect);
-
-  // create sync socket
-  if(!m_user.getChatroom().isEmpty()) {
-    std::string syncPrefix = BROADCAST_PREFIX_FOR_SYNC_DEMO;
-    syncPrefix += "/";
-    syncPrefix += m_user.getChatroom().toStdString();
-    try 
-    {
-      m_sock = new Sync::SyncAppSocket(syncPrefix, bind(&ChatDialog::processTreeUpdateWrapper, this, _1, _2), bind(&ChatDialog::processRemove, this, _1));
-    }
-    catch (Sync::CcnxOperationException ex)
-    {
-      QMessageBox::critical(this, tr("Sync-Demo"), tr("Canno connect to ccnd.\n Have you started your ccnd?"), QMessageBox::Ok);
-      std::exit(1);
-    }
-  }
-
-  connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
-  connect(setButton, SIGNAL(pressed()), this, SLOT(buttonPressed()));
-  connect(this, SIGNAL(dataReceived(QString, const char *, size_t)), this, SLOT(processData(QString, const char *, size_t)));
-  connect(this, SIGNAL(treeUpdated(const std::vector<Sync::MissingDataInfo>)), this, SLOT(processTreeUpdate(const std::vector<Sync::MissingDataInfo>)));
-  //testDraw();
-}
-
-ChatDialog::~ChatDialog()
-{
-  if (m_sock != NULL) 
-  {
-    delete m_sock;
-    m_sock = NULL;
-  }
-}
-
-void
-ChatDialog::appendMessage(const SyncDemo::ChatMessage msg) 
-{
-  boost::mutex::scoped_lock lock(m_msgMutex);
-
-  if (msg.type() != SyncDemo::ChatMessage::CHAT) {
-    return;
-  }
-
-  if (!msg.has_data()) {
-    return;
-  }
-
-  if (msg.from().empty() || msg.data().empty()) {
-    return;
-  }
-
-  QTextCursor cursor(textEdit->textCursor());
-  cursor.movePosition(QTextCursor::End);
-  QTextTableFormat tableFormat;
-  tableFormat.setBorder(0);
-  QTextTable *table = cursor.insertTable(1, 2, tableFormat);
-  QString from = QString("<%1>: ").arg(msg.from().c_str());
-  table->cellAt(0, 0).firstCursorPosition().insertText(from);
-  table->cellAt(0, 1).firstCursorPosition().insertText(msg.data().c_str());
-  QScrollBar *bar = textEdit->verticalScrollBar();
-  bar->setValue(bar->maximum());
-}
-
-void
-ChatDialog::processTreeUpdateWrapper(const std::vector<Sync::MissingDataInfo> v, Sync::SyncAppSocket *sock)
-{
-  emit treeUpdated(v);
-#ifdef __DEBUG
-  std::cout << "<<< Tree update signal emitted" << std::endl;
-#endif
-}
-
-void
-ChatDialog::processTreeUpdate(const std::vector<Sync::MissingDataInfo> v)
-{
-#ifdef __DEBUG
-  std::cout << "<<< processing Tree Update" << std::endl;
-#endif
-  if (v.empty())
-  {
-    return;
-  }
-
-  // reflect the changes on digest tree
-  {
-    boost::mutex::scoped_lock lock(m_sceneMutex);
-    m_scene->processUpdate(v, m_sock->getRootDigest().c_str());
-  }
-
-  int n = v.size();
-  int totalMissingPackets = 0;
-  for (int i = 0; i < n; i++) 
-  {
-    totalMissingPackets += v[i].high.getSeq() - v[i].low.getSeq() + 1;
-  }
-  
-  if (totalMissingPackets < 10) {
-    for (int i = 0; i < n; i++) 
-    {
-      for (Sync::SeqNo seq = v[i].low; seq <= v[i].high; ++seq)
-      {
-        m_sock->fetchRaw(v[i].prefix, seq, bind(&ChatDialog::processDataWrapper, this, _1, _2, _3), 2);
-#ifdef __DEBUG
-        std::cout << "<<< Fetching " << v[i].prefix << "/" <<seq.getSession() <<"/" << seq.getSeq() << std::endl;
-#endif
-      }
-    }
-  }
-  else
-  {
-    // too bad; too many missing packets
-    // we may just join a new chatroom
-    // or some network patition just healed
-    // we don't try to fetch any data in this case (for now)
-  }
-
-  // adjust the view
-  fitView();
-
-}
-
-void
-ChatDialog::processDataWrapper(std::string name, const char *buf, size_t len)
-{
-  emit dataReceived(name.c_str(), buf, len);
-#ifdef __DEBUG
-  std::cout <<"<<< " << name << " fetched" << std::endl;
-#endif
-}
-
-void
-ChatDialog::processData(QString name, const char *buf, size_t len)
-{
-  SyncDemo::ChatMessage msg;
-  if (!msg.ParseFromArray(buf, len)) 
-  {
-    std::cerr << "Errrrr.. Can not parse msg at "<<__FILE__ <<":"<<__LINE__<<". what is happening?" << std::endl;
-    abort();
-  }
-
-  // display msg received from network
-  // we have to do so; this function is called by ccnd thread
-  // so if we call appendMsg directly
-  // Qt crash as "QObject: Cannot create children for a parent that is in a different thread"
-  // the "cannonical" way to is use signal-slot
-  appendMessage(msg);
-  
-  // update the tree view
-  std::string stdStrName = name.toStdString();
-  std::string stdStrNameWithoutSeq = stdStrName.substr(0, stdStrName.find_last_of('/'));
-  std::string prefix = stdStrNameWithoutSeq.substr(0, stdStrNameWithoutSeq.find_last_of('/'));
-#ifdef __DEBUG
-  std::cout <<"<<< updating scene for" << prefix << ": " << msg.from()  << std::endl;
-#endif
-  {
-    boost::mutex::scoped_lock lock(m_sceneMutex);
-    m_scene->msgReceived(prefix.c_str(), msg.from().c_str());
-  }
-  fitView();
-}
-
-void
-ChatDialog::processRemove(std::string prefix)
-{
-}
-
-void
-ChatDialog::formChatMessage(const QString &text, SyncDemo::ChatMessage &msg) {
-  msg.set_from(m_user.getNick().toStdString());
-  msg.set_to(m_user.getChatroom().toStdString());
-  msg.set_data(text.toStdString());
-  time_t seconds = time(NULL);
-  msg.set_timestamp(seconds);
-  msg.set_type(SyncDemo::ChatMessage::CHAT);
-}
-
-bool
-ChatDialog::readSettings()
-{
-#ifndef __DEBUG
-  QSettings s(ORGANIZATION, APPLICATION);
-  QString nick = s.value("nick", "").toString();
-  QString chatroom = s.value("chatroom", "").toString();
-  QString prefix = s.value("prefix", "").toString();
-  if (nick == "" || chatroom == "" || prefix == "") {
-    QTimer::singleShot(500, this, SLOT(buttonPressed()));
-    return false;
-  }
-  else {
-    m_user.setNick(nick);
-    m_user.setChatroom(chatroom);
-    m_user.setPrefix(prefix);
-    return true;
-  }
-#else
-  QTimer::singleShot(500, this, SLOT(buttonPressed()));
-  return false;
-#endif
-}
-
-void 
-ChatDialog::writeSettings()
-{
-#ifndef __DEBUG
-  QSettings s(ORGANIZATION, APPLICATION);
-  s.setValue("nick", m_user.getNick());
-  s.setValue("chatroom", m_user.getChatroom());
-  s.setValue("prefix", m_user.getPrefix());
-#endif
-}
-
-void
-ChatDialog::updateLabels()
-{
-  QString settingDisp = QString("<User: %1>, <Chatroom: %2>").arg(m_user.getNick()).arg(m_user.getChatroom());
-  infoLabel->setText(settingDisp);
-  QString prefixDisp = QString("<Prefix: %1>").arg(m_user.getPrefix());
-  prefixLabel->setText(prefixDisp);
-}
-
-void 
-ChatDialog::returnPressed()
-{
-  QString text = lineEdit->text();
-  if (text.isEmpty())
-    return;
- 
-  lineEdit->clear();
-
-  SyncDemo::ChatMessage msg;
-  formChatMessage(text, msg);
-  
-  appendMessage(msg);
-
-  // send msg
-  size_t size = msg.ByteSize();
-  char *buf = new char[size];
-  msg.SerializeToArray(buf, size);
-  if (!msg.IsInitialized()) 
-  {
-    std::cerr << "Errrrr.. msg was not probally initialized "<<__FILE__ <<":"<<__LINE__<<". what is happening?" << std::endl;
-    abort();
-  }
-  m_sock->publishRaw(m_user.getPrefix().toStdString(), m_session, buf, size, 60);
-
-  int nextSequence = m_sock->getNextSeq(m_user.getPrefix().toStdString(), m_session);
-  Sync::MissingDataInfo mdi = {m_user.getPrefix().toStdString(), Sync::SeqNo(0), Sync::SeqNo(nextSequence - 1)};
-  std::vector<Sync::MissingDataInfo> v;
-  v.push_back(mdi);
-  {
-    boost::mutex::scoped_lock lock(m_sceneMutex);
-    m_scene->processUpdate(v, m_sock->getRootDigest().c_str());
-    m_scene->msgReceived(m_user.getPrefix(), m_user.getNick());
-  }
-  fitView();
-}
-
-void
-ChatDialog::buttonPressed()
-{
-  SettingDialog dialog(this, m_user.getNick(), m_user.getChatroom(), m_user.getPrefix());
-  connect(&dialog, SIGNAL(updated(QString, QString, QString)), this, SLOT(settingUpdated(QString, QString, QString)));
-  dialog.exec();
-  QTimer::singleShot(100, this, SLOT(checkSetting()));
-}
-
-void
-ChatDialog::checkSetting()
-{
-  if (m_user.getPrefix().isEmpty() || m_user.getNick().isEmpty() || m_user.getChatroom().isEmpty())
-  {
-    buttonPressed();
-  }
-}
-
-void
-ChatDialog::settingUpdated(QString nick, QString chatroom, QString prefix)
-{
-  bool needWrite = false;
-  if (!nick.isEmpty() && nick != m_user.getNick()) {
-    m_user.setNick(nick);
-    needWrite = true;
-  }
-  if (!prefix.isEmpty() && prefix != m_user.getPrefix()) {
-    m_user.setPrefix(prefix);
-    needWrite = true;
-    // TODO: set the previous prefix as left?
-  }
-  if (!chatroom.isEmpty() && chatroom != m_user.getChatroom()) {
-    m_user.setChatroom(chatroom);
-    needWrite = true;
-
-    {
-      boost::mutex::scoped_lock lock(m_sceneMutex);
-      m_scene->clearAll();
-      m_scene->plot("Empty");
-    }
-    // TODO: perhaps need to do a lot. e.g. use a new SyncAppSokcet
-    if (m_sock != NULL) 
-    {
-      delete m_sock;
-      m_sock = NULL;
-    }
-    std::string syncPrefix = BROADCAST_PREFIX_FOR_SYNC_DEMO;
-    syncPrefix += "/";
-    syncPrefix += m_user.getChatroom().toStdString();
-    try
-    {
-      m_sock = new Sync::SyncAppSocket(syncPrefix, bind(&ChatDialog::processTreeUpdateWrapper, this, _1, _2), bind(&ChatDialog::processRemove, this, _1));
-    }
-    catch (Sync::CcnxOperationException ex)
-    {
-      QMessageBox::critical(this, tr("Sync-Demo"), tr("Canno connect to ccnd.\n Have you started your ccnd?"), QMessageBox::Ok);
-      std::exit(1);
-    }
-
-    fitView();
-    
-  }
-  if (needWrite) {
-    writeSettings();
-    updateLabels();
-  }
-}
-
-void 
-ChatDialog::resizeEvent(QResizeEvent *e)
-{
-  fitView();
-}
-
-void 
-ChatDialog::showEvent(QShowEvent *e)
-{
-  fitView();
-}
-
-void
-ChatDialog::fitView()
-{
-  boost::mutex::scoped_lock lock(m_sceneMutex);
-  QRectF rect = m_scene->itemsBoundingRect();
-  m_scene->setSceneRect(rect);
-  treeViewer->fitInView(m_scene->itemsBoundingRect(), Qt::KeepAspectRatio);
-}
diff --git a/demo/chatdialog.h b/demo/chatdialog.h
deleted file mode 100644
index e5e0c34..0000000
--- a/demo/chatdialog.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef CHATDIALOG_H
-#define CHATDIALOG_H
-#include <boost/function.hpp>
-#include <boost/thread/mutex.hpp>
-#include <vector>
-#include "digesttreescene.h"
-#include "ui_chatdialog.h"
-#include "chatbuf.pb.h"
-#include <sync-app-socket.h>
-#include <sync-logic.h>
-#include <sync-seq-no.h>
-
-#define ORGANIZATION "IRL@UCLA"
-#define APPLICATION "SYNC-DEMO"
-
-class ChatDialog : public QDialog,  private Ui::ChatDialog 
-{
-	Q_OBJECT
-
-public:
-	ChatDialog(QWidget *parent = 0);
-  ~ChatDialog();
-  void processRemove(const std::string);
-  void appendMessage(const SyncDemo::ChatMessage msg);
-  void processTreeUpdateWrapper(const std::vector<Sync::MissingDataInfo>, Sync::SyncAppSocket *);
-  void processDataWrapper(std::string, const char *buf, size_t len);
-
-public slots:
-  void processTreeUpdate(const std::vector<Sync::MissingDataInfo>);
-  void processData(QString name, const char *buf, size_t len);
-
-private:
-  void formChatMessage(const QString &text, SyncDemo::ChatMessage &msg);
-  bool readSettings();
-  void writeSettings();
-  void updateLabels();
-  void resizeEvent(QResizeEvent *);
-  void showEvent(QShowEvent *);
-  void fitView();
-  void testDraw();
-
-private slots:
-  void returnPressed();
-  void buttonPressed();
-  void checkSetting();
-  void settingUpdated(QString, QString, QString);
-
-signals:
-  void dataReceived(QString name, const char *buf, size_t len);
-  void treeUpdated(const std::vector<Sync::MissingDataInfo>);
-
-private:
-  User m_user; 
-  Sync::SyncAppSocket *m_sock;
-  uint32_t m_session;
-  DigestTreeScene *m_scene;
-  boost::mutex m_msgMutex;
-  boost::mutex m_sceneMutex;
-};
-#endif
diff --git a/demo/chatdialog.ui b/demo/chatdialog.ui
deleted file mode 100644
index 9e659ab..0000000
--- a/demo/chatdialog.ui
+++ /dev/null
@@ -1,121 +0,0 @@
-<ui version="4.0">
-  <class>ChatDialog</class>
-  <widget class="QDialog" name="ChatDialog">
-    <property name="geometry">
-      <rect>
-      <x>0</x>
-      <y>0</y>
-      <width>600</width>
-      <height>600</height>
-      </rect>
-    </property>
-    <property name="windowTitle">
-      <string>Sync Demo</string>
-    </property>
-    <layout class="QVBoxLayout">
-      <property name="spacing">
-        <number>6</number>
-      </property>
-      <item>
-        <layout class="QVBoxLayout">
-          <property name="margin">
-           <number>0</number>
-          </property>
-          <property name="spacing">
-            <number>6</number>
-          </property>
-          <item >
-            <layout class="QHBoxLayout">
-              <property name="margin">
-                <number>0</number>
-              </property>
-              <property name="spacing">
-                <number>6</number>
-              </property>
-              <item>
-                <layout class = "QVBoxLayout" >
-                  <property name="margin">
-                    <number>0</number>
-                  </property>
-                  <property name="spacing">
-                    <number>6</number>
-                  </property>
-                  <item>
-                    <widget class="QLabel" name="infoLabel">
-                    <property name="focusPolicy">
-                      <enum>Qt::NoFocus</enum>
-                    </property>
-                    </widget>
-                  </item>
-                  <item>
-                    <widget class="QLabel" name="prefixLabel">
-                    <property name="focusPolicy">
-                      <enum>Qt::NoFocus</enum>
-                    </property>
-                    </widget>
-                  </item>
-                </layout>
-              </item>
-              <item>
-                <widget class="QPushButton" name="setButton">
-                <property name="focusPolicy">
-                  <enum>Qt::NoFocus</enum>
-                </property>
-                <property name="text">
-                  <string>Settings</string> 
-                </property>
-                <property name="minimumWidth">
-                  <number>150</number>
-                </property>
-                <property name="maximumWidth">
-                  <number>150</number>
-                </property>
-                </widget>
-              </item>
-            </layout>
-          </item>
-          <item>
-            <widget class="QGraphicsView" name="treeViewer">
-            <property name="focusPolicy">
-              <enum>Qt::NoFocus</enum>
-            </property>
-            </widget>
-          </item>
-          <item>
-            <widget class="QTextEdit" name="textEdit">
-              <property name="focusPolicy">
-                <enum>Qt::NoFocus</enum>
-              </property>
-              <property name="readOnly">
-                <bool>true</bool>
-              </property>
-            </widget>
-          </item>
-        </layout>
-      </item>
-      <item>
-        <layout class="QHBoxLayout">
-          <property name="margin">
-            <number>0</number>
-          </property>
-          <property name="spacing">
-            <number>6</number>
-          </property>
-          <item>
-            <widget class="QLabel" name="label">
-              <property name="text">
-                <string>Message:</string>
-              </property>
-            </widget>
-          </item>
-          <item>
-            <widget class="QLineEdit" name="lineEdit" />
-          </item>
-        </layout>
-      </item>
-    </layout>
-  </widget>
-  <resources/>
-  <connections/>
-</ui>
-	
diff --git a/demo/digesttreescene.cpp b/demo/digesttreescene.cpp
deleted file mode 100644
index 30c087e..0000000
--- a/demo/digesttreescene.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-#include <QtGui>
-#include <vector>
-#include <iostream>
-#include <assert.h>
-#include <boost/lexical_cast.hpp>
-#include <memory>
-#include "digesttreescene.h"
-
-static const double Pi = 3.14159265358979323846264338327950288419717;
-
-
-DigestTreeScene::DisplayUserPtr DigestTreeScene::DisplayUserNullPtr;
-
-DigestTreeScene::DigestTreeScene(QWidget *parent)
-  : QGraphicsScene(parent)
-{
-  previouslyUpdatedUser = DisplayUserNullPtr;
-}
-
-void
-DigestTreeScene::processUpdate(const std::vector<Sync::MissingDataInfo> &v, QString digest)
-{
-  int n = v.size();
-  bool rePlot = false; 
-  for (int i = 0; i < n; i++) 
-  {
-    Roster_iterator it = m_roster.find(v[i].prefix.c_str());
-    if (it == m_roster.end()) 
-    {
-      rePlot = true; 
-      DisplayUserPtr p(new DisplayUser());
-      p->setPrefix(v[i].prefix.c_str());
-      p->setSeq(v[i].high);
-      m_roster.insert(p->getPrefix(), p);
-    }
-    else 
-    {
-      it.value()->setSeq(v[i].high);
-    }
-  }
-
-  if (rePlot) 
-  {
-    plot(digest);
-  }
-  else 
-  {
-    for (int i = 0; i < n; i++) 
-    {
-      Roster_iterator it = m_roster.find(v[i].prefix.c_str());
-      if (it != m_roster.end()) {
-        DisplayUserPtr p = it.value();
-        QGraphicsTextItem *item = p->getSeqTextItem();
-        QGraphicsRectItem *rectItem = p->getInnerRectItem();
-        std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
-        item->setPlainText(s.c_str());
-        QRectF textBR = item->boundingRect();
-        QRectF rectBR = rectItem->boundingRect();
-        item->setPos(rectBR.x() + (rectBR.width() - textBR.width())/2, rectBR.y() + (rectBR.height() - textBR.height())/2);
-      }
-    }
-    m_rootDigest->setPlainText(digest);
-  }
-}
-
-void
-DigestTreeScene::msgReceived(QString prefix, QString nick)
-{
-#ifdef __DEBUG
-  std::cout << "Finding " << prefix.toStdString() << std::endl;
-#endif
-  Roster_iterator it = m_roster.find(prefix);
-  if (it != m_roster.end()) 
-  {
-    DisplayUserPtr p = it.value();
-    if (nick != p->getNick()) {
-      p->setNick(nick);
-      QGraphicsTextItem *nickItem = p->getNickTextItem();
-      QGraphicsRectItem *nickRectItem = p->getNickRectItem();
-      nickItem->setPlainText(p->getNick());
-      QRectF rectBR = nickRectItem->boundingRect();
-      QRectF nickBR = nickItem->boundingRect();
-      nickItem->setPos(rectBR.x() + (rectBR.width() - nickBR.width())/2, rectBR.y() + 5);
-    }
-
-    reDrawNode(p, Qt::red);
-
-    if (previouslyUpdatedUser != DisplayUserNullPtr && previouslyUpdatedUser != p) 
-    {
-      reDrawNode(previouslyUpdatedUser, Qt::darkBlue);
-    }
-
-    previouslyUpdatedUser = p;
-  }
-#ifdef __DEBUG
-  else 
-  {
-    std::cout << "Couldn't find prefix, let's check"<< std::endl;
-    Roster_iterator ii = m_roster.begin();
-    while (ii != m_roster.end())
-    {
-      std::cout <<"Prefix: " << ii.key().toStdString() << std::endl;
-      ++ii;
-    }
-  }
-#endif
-}
-
-void
-DigestTreeScene::clearAll()
-{
-  clear();
-  m_roster.clear();
-}
-
-void
-DigestTreeScene::plot(QString digest)
-{
-  clear();
-
-  int nodeSize = 40;
-
-  int siblingDistance = 100, levelDistance = 100;
-  std::auto_ptr<TreeLayout> layout(new OneLevelTreeLayout());
-  layout->setSiblingDistance(siblingDistance);
-  layout->setLevelDistance(levelDistance);
-
-  int n = m_roster.size();
-  std::vector<TreeLayout::Coordinate> childNodesCo(n);
-
-  layout->setOneLevelLayout(childNodesCo);
-
-  plotEdge(childNodesCo, nodeSize);
-  plotNode(childNodesCo, digest, nodeSize);
-
-  previouslyUpdatedUser = DisplayUserNullPtr;
-
-}
-
-void
-DigestTreeScene::plotEdge(const std::vector<TreeLayout::Coordinate> &childNodesCo, int nodeSize)
-{
-  int n = childNodesCo.size();
-  for (int i = 0; i < n; i++) {
-    double x1 = 0.0, y1 = 0.0;
-    double x2 = childNodesCo[i].x, y2 = childNodesCo[i].y;
-    QPointF src(x1 + nodeSize/2, y1 + nodeSize/2);
-    QPointF dest(x2 + nodeSize/2, y2 + nodeSize/2);
-    QLineF line(src, dest);
-    double angle = ::acos(line.dx() / line.length());
-
-    double arrowSize = 10;
-    QPointF sourceArrowP0 = src + QPointF((nodeSize/2 + 10) * line.dx() / line.length(),  (nodeSize/2 +10) * line.dy() / line.length());
-    QPointF sourceArrowP1 = sourceArrowP0 + QPointF(cos(angle + Pi / 3 - Pi/2) * arrowSize,
-                                                    sin(angle + Pi / 3 - Pi/2) * arrowSize);
-    QPointF sourceArrowP2 = sourceArrowP0 + QPointF(cos(angle + Pi - Pi / 3 - Pi/2) * arrowSize,
-                                                         sin(angle + Pi - Pi / 3 - Pi/2) * arrowSize);
-
-    addLine(QLineF(sourceArrowP0, dest), QPen(Qt::black));
-    addPolygon(QPolygonF() << sourceArrowP0<< sourceArrowP1 << sourceArrowP2, QPen(Qt::black), QBrush(Qt::black));
-  }
-}
-
-void
-DigestTreeScene::plotNode(const std::vector<TreeLayout::Coordinate> &childNodesCo, QString digest, int nodeSize)
-{
-  RosterIterator it(m_roster);
-  int n = childNodesCo.size();
-  int rim = 3;
-
-  // plot root node
-  QRectF rootBoundingRect(0, 0, nodeSize, nodeSize);
-  QRectF rootInnerBoundingRect(rim, rim, nodeSize - rim * 2, nodeSize - rim * 2);
-  addRect(rootBoundingRect, QPen(Qt::black), QBrush(Qt::darkRed));
-  addRect(rootInnerBoundingRect, QPen(Qt::black), QBrush(Qt::lightGray));
-  QRectF digestRect(- 5.5 * nodeSize , - nodeSize, 12 * nodeSize, 30);
-  addRect(digestRect, QPen(Qt::darkCyan), QBrush(Qt::darkCyan));
-
-  QGraphicsTextItem *digestItem = addText(digest);
-  QRectF digestBoundingRect = digestItem->boundingRect();
-  digestItem->setDefaultTextColor(Qt::black);
-  digestItem->setFont(QFont("Cursive", 12, QFont::Bold));
-  digestItem->setPos(- 4.5 * nodeSize + (12 * nodeSize - digestBoundingRect.width()) / 2, - nodeSize + 5);
-  m_rootDigest = digestItem;
-
-  // plot child nodes
-  for (int i = 0; i < n; i++)
-  {
-    if (it.hasNext()) 
-    {
-      it.next();
-    }
-    else 
-    {
-      abort();
-    }
-
-    double x = childNodesCo[i].x;
-    double y = childNodesCo[i].y;
-    QRectF boundingRect(x, y, nodeSize, nodeSize);
-    QRectF innerBoundingRect(x + rim, y + rim, nodeSize - rim * 2, nodeSize - rim * 2);
-    DisplayUserPtr p = it.value();
-    QGraphicsRectItem *rectItem = addRect(boundingRect, QPen(Qt::black), QBrush(Qt::darkBlue));
-    p->setRimRectItem(rectItem);
-
-    QGraphicsRectItem *innerRectItem = addRect(innerBoundingRect, QPen(Qt::black), QBrush(Qt::lightGray));
-    p->setInnerRectItem(innerRectItem);
-
-    std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
-    QGraphicsTextItem *seqItem = addText(s.c_str());
-    seqItem->setFont(QFont("Cursive", 12, QFont::Bold));
-    QRectF seqBoundingRect = seqItem->boundingRect(); 
-    seqItem->setPos(x + nodeSize / 2 - seqBoundingRect.width() / 2, y + nodeSize / 2 - seqBoundingRect.height() / 2);
-    p->setSeqTextItem(seqItem);
-
-    QRectF textRect(x - nodeSize / 2, y + nodeSize, 2 * nodeSize, 30);
-    QGraphicsRectItem *nickRectItem = addRect(textRect, QPen(Qt::darkCyan), QBrush(Qt::darkCyan));
-    p->setNickRectItem(nickRectItem);
-    QGraphicsTextItem *nickItem = addText(p->getNick());
-    QRectF textBoundingRect = nickItem->boundingRect();
-    nickItem->setDefaultTextColor(Qt::white);
-    nickItem->setFont(QFont("Cursive", 12, QFont::Bold));
-    nickItem->setPos(x + nodeSize / 2 - textBoundingRect.width() / 2, y + nodeSize + 5);
-    p->setNickTextItem(nickItem);
-  }
-
-}
-
-void
-DigestTreeScene::reDrawNode(DisplayUserPtr p, QColor rimColor)
-{
-    QGraphicsRectItem *rimItem = p->getRimRectItem();
-    rimItem->setBrush(QBrush(rimColor));
-    QGraphicsRectItem *innerItem = p->getInnerRectItem();
-    innerItem->setBrush(QBrush(Qt::lightGray));
-    QGraphicsTextItem *seqTextItem = p->getSeqTextItem();
-    std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
-    seqTextItem->setPlainText(s.c_str());
-    QRectF textBR = seqTextItem->boundingRect();
-    QRectF innerBR = innerItem->boundingRect();
-    seqTextItem->setPos(innerBR.x() + (innerBR.width() - textBR.width())/2, innerBR.y() + (innerBR.height() - textBR.height())/2);
-}
-
diff --git a/demo/digesttreescene.h b/demo/digesttreescene.h
deleted file mode 100644
index f041b11..0000000
--- a/demo/digesttreescene.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef DIGESTTREESCENE_H
-#define DIGESTTREESCENE_H
-
-#include <QtGui/QGraphicsScene>
-#include <sync-seq-no.h>
-#include <sync-logic.h>
-#include <ctime>
-#include <QMap>
-#include <vector>
-#include <tr1/memory>
-#include <QColor>
-#include "treelayout.h"
-
-class QGraphicsTextItem;
-
-class User;
-class DisplayUser;
-
-class DigestTreeScene : public QGraphicsScene
-{
-  Q_OBJECT
-
-typedef std::tr1::shared_ptr<DisplayUser> DisplayUserPtr;
-typedef QMap<QString, DisplayUserPtr> Roster;
-typedef QMap<QString, DisplayUserPtr>::iterator Roster_iterator;
-typedef QMapIterator<QString, DisplayUserPtr> RosterIterator;
-static DisplayUserPtr DisplayUserNullPtr;
-
-public:
-  DigestTreeScene(QWidget *parent = 0);
-  void processUpdate(const std::vector<Sync::MissingDataInfo> &v, QString digest);
-  void msgReceived(QString prefix, QString nick);
-  void clearAll();
-  void plot(QString digest);
-private:
-  void plotEdge(const std::vector<TreeLayout::Coordinate> &v, int nodeSize);
-  void plotNode(const std::vector<TreeLayout::Coordinate> &v, QString digest, int nodeSize);
-  void reDrawNode(DisplayUserPtr p, QColor rimColor);
-private:
-  Roster m_roster;
-  QGraphicsTextItem *m_rootDigest; 
-  DisplayUserPtr previouslyUpdatedUser;
-
-};
-
-class User 
-{
-public:
-  User():m_received(time(NULL)) {}
-  User(QString n, QString p, QString c): m_nick(n), m_prefix(p), m_chatroom(c), m_received(time(NULL)) {}
-  void setNick(QString nick) {m_nick = nick;}
-  void setPrefix(QString prefix) {m_prefix = prefix;}
-  void setChatroom(QString chatroom) {m_chatroom = chatroom;}
-  void setSeq(Sync::SeqNo seq) {m_seq = seq;}
-  void setReceived() {m_received = time(NULL);}
-  QString getNick() { return m_nick;}
-  QString getPrefix() { return m_prefix;}
-  QString getChatroom() { return m_chatroom;}
-  Sync::SeqNo getSeqNo() { return m_seq;}
-  time_t getReceived() { return m_received;}
-private:
-  QString m_nick;
-  QString m_prefix;
-  QString m_chatroom;
-  Sync::SeqNo m_seq;
-  time_t m_received;
-};
-
-class DisplayUser : public User 
-{
-public:
-  DisplayUser():m_seqTextItem(NULL), m_nickTextItem(NULL), m_rimRectItem(NULL) {}
-  DisplayUser(QString n, QString p , QString c): User(n, p, c), m_seqTextItem(NULL), m_nickTextItem(NULL), m_rimRectItem(NULL) {}
-  QGraphicsTextItem *getSeqTextItem() {return m_seqTextItem;}
-  QGraphicsTextItem *getNickTextItem() {return m_nickTextItem;}
-  QGraphicsRectItem *getRimRectItem() {return m_rimRectItem;}
-  QGraphicsRectItem *getInnerRectItem() {return m_innerRectItem;}
-  QGraphicsRectItem *getNickRectItem() {return m_nickRectItem;}
-  void setSeqTextItem(QGraphicsTextItem *item) { m_seqTextItem = item;}
-  void setNickTextItem(QGraphicsTextItem *item) { m_nickTextItem = item;}
-  void setRimRectItem(QGraphicsRectItem *item) {m_rimRectItem = item;}
-  void setInnerRectItem(QGraphicsRectItem *item) {m_innerRectItem = item;}
-  void setNickRectItem(QGraphicsRectItem *item) {m_nickRectItem = item;}
-private:
-  QGraphicsTextItem *m_seqTextItem;
-  QGraphicsTextItem *m_nickTextItem;
-  QGraphicsRectItem *m_rimRectItem;
-  QGraphicsRectItem *m_innerRectItem;
-  QGraphicsRectItem *m_nickRectItem;
-};
-
-#endif
diff --git a/demo/main.cpp b/demo/main.cpp
deleted file mode 100644
index 6b73923..0000000
--- a/demo/main.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#include<QApplication>
-#include "chatdialog.h"
-
-int main(int argc, char *argv[]) 
-{
-  QApplication app(argc, argv);
-  
-  ChatDialog dialog;
-  dialog.show();
-  dialog.activateWindow();
-  return app.exec();
-}
diff --git a/demo/settingdialog.cpp b/demo/settingdialog.cpp
deleted file mode 100644
index 8f0bbca..0000000
--- a/demo/settingdialog.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "settingdialog.h"
-#include <QRegExp>
-#include <QValidator>
-
-SettingDialog::SettingDialog(QWidget *parent, QString nick, QString chatroom, QString prefix)
-  : QDialog(parent)
-{
-  setupUi(this);
-
-  QRegExp noWhiteSpace("^\\S+.*$");
-  QValidator *nwsValidator = new QRegExpValidator(noWhiteSpace, this);
-  nickEdit->setPlaceholderText(nick);
-  nickEdit->setValidator(nwsValidator);
-  roomEdit->setPlaceholderText(chatroom);
-  roomEdit->setValidator(nwsValidator);
-  prefixEdit->setPlaceholderText(prefix);
-
-  // simple validator for ccnx prefix
-  QRegExp rx("(^(/[^/]+)+$)|(^/$)");
-  QValidator *validator = new QRegExpValidator(rx, this);
-  prefixEdit->setValidator(validator);
-
-  okButton->setDefault(true);
-
-  connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
-  connect(okButton, SIGNAL(clicked()), this, SLOT(update()));
-}
-
-void
-SettingDialog::update() 
-{
-  emit updated(nickEdit->text(), roomEdit->text(), prefixEdit->text()); 
-  accept();
-}
-
-void
-SettingDialog::keyPressEvent(QKeyEvent *e)
-{
-  switch(e->key()) {
-    case Qt::Key_Enter:
-      update();
-      break;
-    default:
-      QDialog::keyPressEvent(e);
-  }
-}
diff --git a/demo/settingdialog.h b/demo/settingdialog.h
deleted file mode 100644
index f9fc31c..0000000
--- a/demo/settingdialog.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef SETTINGDIALOG_H
-#define SETTINGDIALOG_H
-#include "ui_settingdialog.h"
-#include <QKeyEvent>
-
-class SettingDialog : public QDialog, private Ui::SettingDialog
-{
-  Q_OBJECT
-
-public:
-  SettingDialog(QWidget *parent = 0, QString nick = QString("NULL"), QString chatroom = QString("NULL"), QString prefix = QString("NULL"));
-  virtual void keyPressEvent(QKeyEvent *e);
-
-private slots:
-  void update();
-  
-signals:
-  void updated(QString, QString, QString);
-
-};
-
-#endif
diff --git a/demo/settingdialog.ui b/demo/settingdialog.ui
deleted file mode 100644
index b848aa9..0000000
--- a/demo/settingdialog.ui
+++ /dev/null
@@ -1,112 +0,0 @@
-<ui version="4.0">
-  <class>SettingDialog</class>
-  <widget class="QDialog" name="SettingDialog">
-    <property name="geometry">
-      <rect>
-      <x>0</x>
-      <y>0</y>
-      <width>300</width>
-      <height>200</height>
-      </rect>
-    </property>
-    <property name="windowTitle">
-      <string>Chat Settings</string>
-    </property>
-    <layout class="QVBoxLayout">
-      <property name="spacing">
-        <number>6</number>
-      </property>
-      <item>
-        <layout class="QHBoxLayout">
-          <property name="spacing">
-            <number>6</number>
-          </property>
-          <!-- first group -->
-          <item>
-            <layout class="QVBoxLayout">
-              <property name="spacing">
-                <number>6</number>
-              </property>
-              <item>
-                <widget class="QLabel">
-                  <property name="text">
-                    <string>Nickname</string>
-                  </property>
-                </widget>
-              </item>
-              <item>
-                <widget class="QLabel">
-                  <property name="text">
-                    <string>Chatroom</string>
-                  </property>
-                </widget>
-              </item>
-              <item>
-                <widget class="QLabel">
-                  <property name="text">
-                    <string>Prefix</string>
-                  </property>
-                </widget>
-              </item>
-            </layout>
-          </item>
-          <!-- first group -->
-
-          <!-- second group -->
-          <item>
-            <layout class="QVBoxLayout">
-              <property name="spacing">
-                <number>6</number>
-              </property>
-              <item>
-                <widget class="QLineEdit" name="nickEdit">
-                  <property name="maxLength">
-                    <number>200</number>
-                  </property>
-                </widget>
-              </item>
-              <item>
-                <widget class="QLineEdit" name="roomEdit">
-                  <property name="maxLength">
-                    <number>200</number>
-                  </property>
-                </widget>
-              </item>
-              <item>
-                <widget class="QLineEdit" name="prefixEdit">
-                  <property name="maxLength">
-                    <number>200</number>
-                  </property>
-                </widget>
-              </item>
-            </layout>
-          </item>
-          <!-- second group -->
-        </layout>
-      </item>
-      <item>
-        <layout class="QHBoxLayout">
-          <property name="spacing">
-            <number>6</number>
-          </property>
-          <item>
-            <widget class="QPushButton" name="cancelButton">
-              <property name="text">
-                <string>Cancel</string>
-              </property>
-            </widget>
-          </item>
-          <item>
-            <widget class="QPushButton" name="okButton">
-              <property name="text">
-                <string>OK</string>
-              </property>
-            </widget>
-          </item>
-        </layout>
-      </item>
-    </layout>
-  </widget>
-  <resources/>
-  <connections/>
-</ui>
diff --git a/demo/sync-demo.pri b/demo/sync-demo.pri
deleted file mode 100644
index 3ff4309..0000000
--- a/demo/sync-demo.pri
+++ /dev/null
@@ -1,18 +0,0 @@
-PROTOPATH += .
-PROTOPATHS = 
-for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p}
-
-protobuf_decl.name = protobuf header
-protobuf_decl.input = PROTOS
-protobuf_decl.output = ${QMAKE_FILE_BASE}.pb.h
-protobuf_decl.commands = protoc --cpp_out="." $${PROTOPATHS} ${QMAKE_FILE_NAME}
-protobuf_decl.variable_out = GENERATED_FILES 
-QMAKE_EXTRA_COMPILERS += protobuf_decl 
-
-protobuf_impl.name  = protobuf implementation
-protobuf_impl.input = PROTOS
-protobuf_impl.output  = ${QMAKE_FILE_BASE}.pb.cc
-protobuf_impl.depends  = ${QMAKE_FILE_BASE}.pb.h
-protobuf_impl.commands = $$escape_expand(\\n)
-protobuf_impl.variable_out = GENERATED_SOURCES
-QMAKE_EXTRA_COMPILERS += protobuf_impl 
diff --git a/demo/sync-demo.pro b/demo/sync-demo.pro
deleted file mode 100644
index 24fcdd1..0000000
--- a/demo/sync-demo.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-TEMPLATE = app
-TARGET = sync-demo
-DEFINES += __DEBUG
-HEADERS = chatdialog.h \
-          digesttreescene.h \
-          settingdialog.h \
-          treelayout.h
-
-SOURCES = main.cpp \
-          chatdialog.cpp \
-          digesttreescene.cpp \
-          settingdialog.cpp \
-          treelayout.cpp 
-
-FORMS = chatdialog.ui \
-        settingdialog.ui
-
-QMAKE_CXXFLAGS *= -g 
-QMAKE_CFLAGS *= -g 
-
-QMAKE_LIBDIR *= /opt/local/lib /usr/local/lib /usr/lib ../build
-INCLUDEPATH *= /opt/local/include /usr/local/include ../include
-LIBS *= -lccn -lssl -lcrypto -lpthread -lprotobuf -lsync
-CONFIG += console 
-
-PROTOS = chatbuf.proto
-include (sync-demo.pri)
diff --git a/demo/treelayout.cpp b/demo/treelayout.cpp
deleted file mode 100644
index 0a40484..0000000
--- a/demo/treelayout.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "treelayout.h"
-
-void
-OneLevelTreeLayout::setOneLevelLayout(std::vector<Coordinate> &childNodesCo)
-{
-  if (childNodesCo.empty())
-  {
-    return;
-  }
-  double y = getLevelDistance();
-  double sd = getSiblingDistance();
-  int n = childNodesCo.size();
-  double x = - (n - 1) * sd / 2;
-  for (int i = 0; i < n; i++)
-  {
-    childNodesCo[i].x = x;
-    childNodesCo[i].y = y;
-    x += sd;
-  }
-}
diff --git a/demo/treelayout.h b/demo/treelayout.h
deleted file mode 100644
index 498210c..0000000
--- a/demo/treelayout.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef TREELAYOUT_H
-#define TREELAYOUT_H
-#include <vector>
-
-class TreeLayout 
-{
-public:
-  struct Coordinate
-  {
-    double x;
-    double y;
-  };
-  TreeLayout(){}
-  virtual void setOneLevelLayout(std::vector<Coordinate> &childNodesCo){};
-  void setSiblingDistance(int d) {m_siblingDistance = d;}
-  void setLevelDistance(int d) {m_levelDistance = d;}
-  int getSiblingDistance() {return m_siblingDistance;}
-  int getLevelDistance() {return m_levelDistance;}
-  virtual ~TreeLayout(){}
-private:
-  int m_siblingDistance;
-  int m_levelDistance;
-};
-
-class OneLevelTreeLayout: public TreeLayout
-{
-public:
-  OneLevelTreeLayout(){}
-  virtual void setOneLevelLayout(std::vector<Coordinate> &childNodesCo);
-  virtual ~OneLevelTreeLayout(){}
-};
-#endif
