diff --git a/src/sync-full-state.cc b/src/sync-full-state.cc
index eb9ca4c..7000606 100644
--- a/src/sync-full-state.cc
+++ b/src/sync-full-state.cc
@@ -45,10 +45,10 @@
 {
 }
 
-ndn::time::Duration
+ndn::time::system_clock::Duration
 FullState::getTimeFromLastUpdate () const
 {
-  return ndn::time::now() - m_lastUpdated;
+  return ndn::time::system_clock::now() - m_lastUpdated;
 }
 
 DigestConstPtr
@@ -81,7 +81,7 @@
 boost::tuple<bool/*inserted*/, bool/*updated*/, SeqNo/*oldSeqNo*/>
 FullState::update (NameInfoConstPtr info, const SeqNo &seq)
 {
-  m_lastUpdated = ndn::time::now();
+  m_lastUpdated = ndn::time::system_clock::now();
 
 
   m_digest.reset ();
@@ -109,7 +109,7 @@
 bool
 FullState::remove (NameInfoConstPtr info)
 {
-  m_lastUpdated = ndn::time::now();
+  m_lastUpdated = ndn::time::system_clock::now();
 
   m_digest.reset ();
 
diff --git a/src/sync-full-state.h b/src/sync-full-state.h
index 28e0078..028c41e 100644
--- a/src/sync-full-state.h
+++ b/src/sync-full-state.h
@@ -51,7 +51,7 @@
    *
    * This value can be used to randomize reconciliation waiting time in SyncApp
    */
-  ndn::time::Duration
+  ndn::time::system_clock::Duration
   getTimeFromLastUpdate () const;
 
   /**
@@ -70,7 +70,7 @@
   remove (NameInfoConstPtr info);
   
 private:
-  ndn::time::Point m_lastUpdated; ///< @brief Time when state was updated last time
+  ndn::time::system_clock::TimePoint m_lastUpdated; ///< @brief Time when state was updated last time
   DigestPtr m_digest;
 };
 
diff --git a/src/sync-interest-container.h b/src/sync-interest-container.h
index 742f053..f674d05 100644
--- a/src/sync-interest-container.h
+++ b/src/sync-interest-container.h
@@ -47,14 +47,14 @@
   Interest (DigestConstPtr digest, const std::string &name, bool unknown=false)
   : m_digest (digest)
   , m_name (name)
-  , m_time (ndn::time::now())
+  , m_time (ndn::time::system_clock::now())
   , m_unknown (unknown)
   {
   }
   
   DigestConstPtr   m_digest;
   std::string      m_name;
-  ndn::time::Point m_time;
+  ndn::time::system_clock::TimePoint m_time;
   bool             m_unknown;
 };
 
@@ -87,7 +87,7 @@
     
     mi::ordered_non_unique<
       mi::tag<timed>,
-      BOOST_MULTI_INDEX_MEMBER(Interest, ndn::time::Point, m_time)
+      BOOST_MULTI_INDEX_MEMBER(Interest, ndn::time::system_clock::TimePoint, m_time)
       >
     >
   >
diff --git a/src/sync-interest-table.cc b/src/sync-interest-table.cc
index a378950..415b641 100644
--- a/src/sync-interest-table.cc
+++ b/src/sync-interest-table.cc
@@ -29,7 +29,7 @@
 namespace Sync
 {
 
-SyncInterestTable::SyncInterestTable (boost::asio::io_service& io, ndn::time::Duration lifetime)
+SyncInterestTable::SyncInterestTable (boost::asio::io_service& io, ndn::time::system_clock::Duration lifetime)
   : m_entryLifetime (lifetime)
   , m_scheduler(io)
 {
@@ -103,7 +103,7 @@
 void SyncInterestTable::expireInterests ()
 { 
   uint32_t count = 0;
-  ndn::time::Point expireTime = ndn::time::now() - m_entryLifetime;
+  ndn::time::system_clock::TimePoint expireTime = ndn::time::system_clock::now() - m_entryLifetime;
   
   while (m_table.size () > 0)
     {
diff --git a/src/sync-interest-table.h b/src/sync-interest-table.h
index 9b7c46b..4810c41 100644
--- a/src/sync-interest-table.h
+++ b/src/sync-interest-table.h
@@ -42,7 +42,7 @@
 class SyncInterestTable
 {
 public:
-  SyncInterestTable (boost::asio::io_service& io, ndn::time::Duration lifetime);
+  SyncInterestTable (boost::asio::io_service& io, ndn::time::system_clock::Duration lifetime);
   ~SyncInterestTable ();
 
   /**
@@ -81,7 +81,7 @@
   expireInterests ();
 
 private:
-  ndn::time::Duration m_entryLifetime;
+  ndn::time::system_clock::Duration m_entryLifetime;
   InterestContainer m_table;
 
   ndn::Scheduler m_scheduler;
diff --git a/src/sync-logic.cc b/src/sync-logic.cc
index 5d20143..617830b 100644
--- a/src/sync-logic.cc
+++ b/src/sync-logic.cc
@@ -49,7 +49,7 @@
   (time::seconds(sec) + time::milliseconds(GET_RANDOM (m_reexpressionJitter)))
 
 #define TIME_MILLISECONDS_WITH_JITTER(ms) \
-  (time::seconds(ms) + time::milliseconds(GET_RANDOM (m_reexpressionJitter)))
+  (time::milliseconds(ms) + time::milliseconds(GET_RANDOM (m_reexpressionJitter)))
 
 namespace Sync {
 
@@ -57,6 +57,9 @@
 
 int SyncLogic::m_instanceCounter = 0;
 
+const int SyncLogic::m_syncResponseFreshness = 1000; // MUST BE dividable by 1000!!!
+const int SyncLogic::m_syncInterestReexpress = 4; // seconds
+
 SyncLogic::SyncLogic (const Name& syncPrefix,
                       const IdentityCertificate& myCertificate,
                       shared_ptr<Validator> validator, 
@@ -430,7 +433,7 @@
       // satisfyPendingSyncInterests (diffLog); // if there are interests in PIT, there is a point to satisfy them using new state
   
       // if state has changed, then it is safe to express a new interest
-      time::Duration after = time::milliseconds(GET_RANDOM (m_reexpressionJitter));
+      time::system_clock::Duration after = time::milliseconds(GET_RANDOM (m_reexpressionJitter));
       // cout << "------------ reexpress interest after: " << after << endl;
       EventId eventId = m_scheduler.scheduleEvent (after,
                                                    bind (&SyncLogic::sendSyncInterest, this));
@@ -602,7 +605,7 @@
   Name interestName = m_syncPrefix;
   interestName.append("recovery").append(os.str());
 
-  time::Duration nextRetransmission = time::milliseconds (m_recoveryRetransmissionInterval + GET_RANDOM (m_reexpressionJitter));
+  time::system_clock::Duration nextRetransmission = time::milliseconds (m_recoveryRetransmissionInterval + GET_RANDOM (m_reexpressionJitter));
 
   m_recoveryRetransmissionInterval <<= 1;
     
@@ -640,7 +643,7 @@
 
   Data syncData(name);
   syncData.setContent(reinterpret_cast<const uint8_t*>(wireData), size);
-  syncData.setFreshnessPeriod(m_syncResponseFreshness);
+  syncData.setFreshnessPeriod(time::milliseconds(m_syncResponseFreshness));
   
   m_keyChain.sign(syncData, m_myCertificate.getName());
   
@@ -658,7 +661,7 @@
     {
       _LOG_DEBUG_ID ("Satisfied our own Interest. Re-expressing (hopefully with a new digest)");
       
-      time::Duration after = time::milliseconds(GET_RANDOM (m_reexpressionJitter));
+      time::system_clock::Duration after = time::milliseconds(GET_RANDOM (m_reexpressionJitter));
       // cout << "------------ reexpress interest after: " << after << endl;
       EventId eventId = m_scheduler.scheduleEvent (after,
                                                    bind (&SyncLogic::sendSyncInterest, this));
diff --git a/src/sync-logic.h b/src/sync-logic.h
index ec8fc29..98ab0aa 100644
--- a/src/sync-logic.h
+++ b/src/sync-logic.h
@@ -193,8 +193,8 @@
   boost::variate_generator<boost::mt19937&, boost::uniform_int<> > m_reexpressionJitter;
 
   static const int m_unknownDigestStoreTime = 10; // seconds
-  static const int m_syncResponseFreshness = 1000; // MUST BE dividable by 1000!!!
-  static const int m_syncInterestReexpress = 4; // seconds
+  static const int m_syncResponseFreshness; // MUST BE dividable by 1000!!!
+  static const int m_syncInterestReexpress; // seconds
 
   static const int m_defaultRecoveryRetransmitInterval = 200; // milliseconds
   uint32_t m_recoveryRetransmissionInterval; // milliseconds
diff --git a/src/sync-socket.cc b/src/sync-socket.cc
index ca015de..9c31f79 100644
--- a/src/sync-socket.cc
+++ b/src/sync-socket.cc
@@ -92,7 +92,7 @@
 {
   shared_ptr<Data> data = make_shared<Data>();
   data->setContent(reinterpret_cast<const uint8_t*>(buf), len);
-  data->setFreshnessPeriod(1000*freshness);
+  data->setFreshnessPeriod(time::milliseconds(1000*freshness));
 
   m_ioService->post(bind(&SyncSocket::publishDataInternal, this, 
                          data, isCert));
diff --git a/src/sync-validator.cc b/src/sync-validator.cc
index 2d86dbe..e1d40d8 100644
--- a/src/sync-validator.cc
+++ b/src/sync-validator.cc
@@ -130,7 +130,7 @@
               Name interestName = m_prefix;
               interestName.append("CHRONOS-INTRO-CERT").append(keyLocatorName.wireEncode());
               Interest interest(interestName);
-              interest.setInterestLifetime(500);
+              interest.setInterestLifetime(time::milliseconds(500));
 
               OnDataValidated onKeyValidated = bind(&SyncValidator::onCertificateValidated, this, 
                                                     _1, data.shared_from_this(), onValidated, onValidationFailed);
diff --git a/tests/test-socket.cc b/tests/test-socket.cc
index e25ef17..61519f8 100644
--- a/tests/test-socket.cc
+++ b/tests/test-socket.cc
@@ -142,9 +142,9 @@
     : m_face1(new ndn::Face(ioService))
     , m_face2(new ndn::Face(ioService))
     , m_face3(new ndn::Face(ioService))
-    , m_name1("/irl.cs.ucla.edu/" + boost::lexical_cast<std::string>(ndn::time::now()))
-    , m_name2("/yakshi.org/" + boost::lexical_cast<std::string>(ndn::time::now()))
-    , m_name3("/google.com/" + boost::lexical_cast<std::string>(ndn::time::now()))
+    , m_name1("/irl.cs.ucla.edu/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
+    , m_name2("/yakshi.org/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
+    , m_name3("/google.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
   {
     m_id1 = m_keyChain.getCertificate(m_keyChain.createIdentity(m_name1));
     m_id2 = m_keyChain.getCertificate(m_keyChain.createIdentity(m_name2));
@@ -272,7 +272,7 @@
   }
 
   void
-  done()
+  done(ndn::shared_ptr<boost::asio::io_service> ioService)
   {
     m_s1.reset();
     m_s2.reset();
@@ -282,6 +282,7 @@
     m_keyChain.deleteIdentity(m_name2);
     m_keyChain.deleteIdentity(m_name3);
 
+    ioService->stop();
   }
 
   ndn::KeyChain m_keyChain;
@@ -299,8 +300,8 @@
   TestSet2(ndn::shared_ptr<boost::asio::io_service> ioService)
     : m_face1(new ndn::Face(ioService))
     , m_face2(new ndn::Face(ioService))
-    , m_name1("/xiaonei.com/" + boost::lexical_cast<std::string>(ndn::time::now()))
-    , m_name2("/mitbbs.com/" + boost::lexical_cast<std::string>(ndn::time::now()))
+    , m_name1("/xiaonei.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
+    , m_name2("/mitbbs.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
   {
     m_id1 = m_keyChain.getCertificate(m_keyChain.createIdentity(m_name1));
     m_id2 = m_keyChain.getCertificate(m_keyChain.createIdentity(m_name2));
@@ -389,13 +390,15 @@
   }
 
   void
-  done()
+  done(ndn::shared_ptr<boost::asio::io_service> ioService)
   {
     m_s1.reset();
     m_s2.reset();
 
     m_keyChain.deleteIdentity(m_name1);
     m_keyChain.deleteIdentity(m_name2);
+
+    ioService->stop();
   }
 
   ndn::KeyChain m_keyChain;
@@ -415,8 +418,8 @@
   TestSet3(ndn::shared_ptr<boost::asio::io_service> ioService)
     : m_face1(new ndn::Face(ioService))
     , m_face2(new ndn::Face(ioService))
-    , m_name1("/xiaonei.com/" + boost::lexical_cast<std::string>(ndn::time::now()))
-    , m_name2("/mitbbs.com/" + boost::lexical_cast<std::string>(ndn::time::now()))
+    , m_name1("/xiaonei.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
+    , m_name2("/mitbbs.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
   {
     m_id1 = m_keyChain.getCertificate(m_keyChain.createIdentity(m_name1));
     m_id2 = m_keyChain.getCertificate(m_keyChain.createIdentity(m_name2));
@@ -505,13 +508,15 @@
   }
 
   void
-  done()
+  done(ndn::shared_ptr<boost::asio::io_service> ioService)
   {
     m_s1.reset();
     m_s2.reset();
 
     m_keyChain.deleteIdentity(m_name1);
     m_keyChain.deleteIdentity(m_name2);
+
+    ioService->stop();
   }
 
   ndn::KeyChain m_keyChain;
@@ -532,40 +537,40 @@
   ndn::Scheduler scheduler(*ioService);
   TestSet1 testSet1(ioService);
 
-  scheduler.scheduleEvent(ndn::time::seconds(0.00), ndn::bind(&TestSet1::createSyncSocket1, &testSet1));
-  scheduler.scheduleEvent(ndn::time::seconds(0.05), ndn::bind(&TestSet1::createSyncSocket2, &testSet1));
-  scheduler.scheduleEvent(ndn::time::seconds(0.10), ndn::bind(&TestSet1::createSyncSocket3, &testSet1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(0), ndn::bind(&TestSet1::createSyncSocket1, &testSet1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(50), ndn::bind(&TestSet1::createSyncSocket2, &testSet1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(100), ndn::bind(&TestSet1::createSyncSocket3, &testSet1));
   string data0 = "Very funny Scotty, now beam down my clothes";
-  scheduler.scheduleEvent(ndn::time::seconds(0.15), ndn::bind(&TestSet1::publishSocket1, &testSet1, data0));
-  scheduler.scheduleEvent(ndn::time::seconds(1.15), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/1", data0));
-  scheduler.scheduleEvent(ndn::time::seconds(1.16), ndn::bind(&TestSet1::check, &testSet1, 1)); 
+  scheduler.scheduleEvent(ndn::time::milliseconds(150), ndn::bind(&TestSet1::publishSocket1, &testSet1, data0));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1150), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/1", data0));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1160), ndn::bind(&TestSet1::check, &testSet1, 1)); 
   string data1 = "Yes, give me that ketchup";
   string data2 = "Don't look conspicuous, it draws fire";
-  scheduler.scheduleEvent(ndn::time::seconds(1.17), ndn::bind(&TestSet1::publishSocket1, &testSet1, data1));
-  scheduler.scheduleEvent(ndn::time::seconds(1.18), ndn::bind(&TestSet1::publishSocket1, &testSet1, data2));
-  scheduler.scheduleEvent(ndn::time::seconds(2.15), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/2", data1));
-  scheduler.scheduleEvent(ndn::time::seconds(2.16), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/3", data2));
-  scheduler.scheduleEvent(ndn::time::seconds(2.17), ndn::bind(&TestSet1::check, &testSet1, 2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1170), ndn::bind(&TestSet1::publishSocket1, &testSet1, data1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1180), ndn::bind(&TestSet1::publishSocket1, &testSet1, data2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(2150), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/2", data1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(2160), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/3", data2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(2170), ndn::bind(&TestSet1::check, &testSet1, 2));
   string data3 = "You surf the Internet, I surf the real world";
   string data4 = "I got a fortune cookie once that said 'You like Chinese food'";
   string data5 = "Real men wear pink. Why? Because their wives make them";
-  scheduler.scheduleEvent(ndn::time::seconds(3.18), ndn::bind(&TestSet1::publishSocket3, &testSet1, data3));
-  scheduler.scheduleEvent(ndn::time::seconds(3.20), ndn::bind(&TestSet1::publishSocket2, &testSet1, data4));
-  scheduler.scheduleEvent(ndn::time::seconds(3.21), ndn::bind(&TestSet1::publishSocket2, &testSet1, data5));
-  scheduler.scheduleEvent(ndn::time::seconds(4.71), ndn::bind(&TestSet1::setSocket3, &testSet1, "/0/1", data3));
-  scheduler.scheduleEvent(ndn::time::seconds(4.72), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/2", data4));
-  scheduler.scheduleEvent(ndn::time::seconds(4.73), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/3", data5));
-  scheduler.scheduleEvent(ndn::time::seconds(4.80), ndn::bind(&TestSet1::check, &testSet1, 3));
+  scheduler.scheduleEvent(ndn::time::milliseconds(3180), ndn::bind(&TestSet1::publishSocket3, &testSet1, data3));
+  scheduler.scheduleEvent(ndn::time::milliseconds(3200), ndn::bind(&TestSet1::publishSocket2, &testSet1, data4));
+  scheduler.scheduleEvent(ndn::time::milliseconds(3210), ndn::bind(&TestSet1::publishSocket2, &testSet1, data5));
+  scheduler.scheduleEvent(ndn::time::milliseconds(4710), ndn::bind(&TestSet1::setSocket3, &testSet1, "/0/1", data3));
+  scheduler.scheduleEvent(ndn::time::milliseconds(4720), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/2", data4));
+  scheduler.scheduleEvent(ndn::time::milliseconds(4730), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/3", data5));
+  scheduler.scheduleEvent(ndn::time::milliseconds(4800), ndn::bind(&TestSet1::check, &testSet1, 3));
   // not sure weither this is simultanous data generation from multiple sources
   _LOG_DEBUG ("Simultaneous publishing");
   string data6 = "Shakespeare says: 'Prose before hos.'";
   string data7 = "Pick good people, talent never wears out";
-  scheduler.scheduleEvent(ndn::time::seconds(5.50), ndn::bind(&TestSet1::publishSocket1, &testSet1, data6));
-  scheduler.scheduleEvent(ndn::time::seconds(5.50), ndn::bind(&TestSet1::publishSocket2, &testSet1, data7));
-  scheduler.scheduleEvent(ndn::time::seconds(6.80), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/4", data6));
-  scheduler.scheduleEvent(ndn::time::seconds(6.80), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/4", data7));
-  scheduler.scheduleEvent(ndn::time::seconds(6.90), ndn::bind(&TestSet1::check, &testSet1, 4));
-  scheduler.scheduleEvent(ndn::time::seconds(7.00), ndn::bind(&TestSet1::done, &testSet1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(5500), ndn::bind(&TestSet1::publishSocket1, &testSet1, data6));
+  scheduler.scheduleEvent(ndn::time::milliseconds(5500), ndn::bind(&TestSet1::publishSocket2, &testSet1, data7));
+  scheduler.scheduleEvent(ndn::time::milliseconds(6800), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/4", data6));
+  scheduler.scheduleEvent(ndn::time::milliseconds(6800), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/4", data7));
+  scheduler.scheduleEvent(ndn::time::milliseconds(6900), ndn::bind(&TestSet1::check, &testSet1, 4));
+  scheduler.scheduleEvent(ndn::time::milliseconds(7000), ndn::bind(&TestSet1::done, &testSet1, ioService));
 
   ioService->run();
 }
@@ -576,19 +581,19 @@
   ndn::Scheduler scheduler(*ioService);
   TestSet2 testSet2(ioService);
 
-  scheduler.scheduleEvent(ndn::time::seconds(0.00), ndn::bind(&TestSet2::createSyncSocket1, &testSet2));
-  scheduler.scheduleEvent(ndn::time::seconds(0.05), ndn::bind(&TestSet2::createSyncSocket2, &testSet2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(0), ndn::bind(&TestSet2::createSyncSocket1, &testSet2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(50), ndn::bind(&TestSet2::createSyncSocket2, &testSet2));
   uint32_t num[5] = {0, 1, 2, 3, 4};
   string data0((const char *) num, sizeof(num));
-  scheduler.scheduleEvent(ndn::time::seconds(0.10), ndn::bind(&TestSet2::publishSocket1, &testSet2, data0));
-  scheduler.scheduleEvent(ndn::time::seconds(0.15), ndn::bind(&TestSet2::setSocket1, &testSet2, (const char *) num, sizeof (num)));
-  scheduler.scheduleEvent(ndn::time::seconds(1.00), ndn::bind(&TestSet2::check, &testSet2, 10));
+  scheduler.scheduleEvent(ndn::time::milliseconds(100), ndn::bind(&TestSet2::publishSocket1, &testSet2, data0));
+  scheduler.scheduleEvent(ndn::time::milliseconds(150), ndn::bind(&TestSet2::setSocket1, &testSet2, (const char *) num, sizeof (num)));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1000), ndn::bind(&TestSet2::check, &testSet2, 10));
   uint32_t newNum[5] = {9, 7, 2, 1, 1};
   string data1((const char *) newNum, sizeof(newNum));
-  scheduler.scheduleEvent(ndn::time::seconds(1.10), ndn::bind(&TestSet2::publishSocket2, &testSet2, data1));
-  scheduler.scheduleEvent(ndn::time::seconds(1.15), ndn::bind(&TestSet2::setSocket2, &testSet2, (const char *) newNum, sizeof (newNum)));
-  scheduler.scheduleEvent(ndn::time::seconds(2.00), ndn::bind(&TestSet2::check, &testSet2, 30));
-  scheduler.scheduleEvent(ndn::time::seconds(7.00), ndn::bind(&TestSet2::done, &testSet2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1100), ndn::bind(&TestSet2::publishSocket2, &testSet2, data1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1150), ndn::bind(&TestSet2::setSocket2, &testSet2, (const char *) newNum, sizeof (newNum)));
+  scheduler.scheduleEvent(ndn::time::milliseconds(2000), ndn::bind(&TestSet2::check, &testSet2, 30));
+  scheduler.scheduleEvent(ndn::time::milliseconds(7000), ndn::bind(&TestSet2::done, &testSet2, ioService));
 
   ioService->run();
 }
@@ -599,19 +604,19 @@
   ndn::Scheduler scheduler(*ioService);
   TestSet3 testSet3(ioService);
 
-  scheduler.scheduleEvent(ndn::time::seconds(0.00), ndn::bind(&TestSet3::createSyncSocket1, &testSet3));
-  scheduler.scheduleEvent(ndn::time::seconds(0.20), ndn::bind(&TestSet3::createSyncSocket2, &testSet3));
+  scheduler.scheduleEvent(ndn::time::milliseconds(0), ndn::bind(&TestSet3::createSyncSocket1, &testSet3));
+  scheduler.scheduleEvent(ndn::time::milliseconds(200), ndn::bind(&TestSet3::createSyncSocket2, &testSet3));
   uint32_t num[5] = {0, 1, 2, 3, 4};
   string data0((const char *) num, sizeof(num));
-  scheduler.scheduleEvent(ndn::time::seconds(1.00), ndn::bind(&TestSet3::publishSocket1, &testSet3, data0));
-  scheduler.scheduleEvent(ndn::time::seconds(1.50), ndn::bind(&TestSet3::setSocket1, &testSet3, (const char *) num, sizeof (num)));
-  scheduler.scheduleEvent(ndn::time::seconds(2.00), ndn::bind(&TestSet3::check, &testSet3, 10));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1000), ndn::bind(&TestSet3::publishSocket1, &testSet3, data0));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1500), ndn::bind(&TestSet3::setSocket1, &testSet3, (const char *) num, sizeof (num)));
+  scheduler.scheduleEvent(ndn::time::milliseconds(2000), ndn::bind(&TestSet3::check, &testSet3, 10));
   uint32_t newNum[5] = {9, 7, 2, 1, 1};
   string data1((const char *) newNum, sizeof(newNum));
-  scheduler.scheduleEvent(ndn::time::seconds(3.00), ndn::bind(&TestSet3::publishSocket2, &testSet3, data1));
-  scheduler.scheduleEvent(ndn::time::seconds(3.50), ndn::bind(&TestSet3::setSocket2, &testSet3, (const char *) newNum, sizeof (newNum)));
-  scheduler.scheduleEvent(ndn::time::seconds(5.00), ndn::bind(&TestSet3::check, &testSet3, 30));
-  scheduler.scheduleEvent(ndn::time::seconds(7.00), ndn::bind(&TestSet3::done, &testSet3));
+  scheduler.scheduleEvent(ndn::time::milliseconds(3000), ndn::bind(&TestSet3::publishSocket2, &testSet3, data1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(3500), ndn::bind(&TestSet3::setSocket2, &testSet3, (const char *) newNum, sizeof (newNum)));
+  scheduler.scheduleEvent(ndn::time::milliseconds(5000), ndn::bind(&TestSet3::check, &testSet3, 30));
+  scheduler.scheduleEvent(ndn::time::milliseconds(7000), ndn::bind(&TestSet3::done, &testSet3, ioService));
 
   ioService->run();
 }
diff --git a/tests/test-sync-logic.cc b/tests/test-sync-logic.cc
index ebce9c0..d430a46 100644
--- a/tests/test-sync-logic.cc
+++ b/tests/test-sync-logic.cc
@@ -93,15 +93,16 @@
   }
 
   void
-  finish()
+  finish(ndn::shared_ptr<boost::asio::io_service> ioService)
   {
+    ioService->stop();
   }
   
   void
   createSyncLogic(int index, 
                   ndn::shared_ptr<Handler> h)
   { 
-    ndn::Name identity("/tmp-" + boost::lexical_cast<std::string>(ndn::time::now()));
+    ndn::Name identity("/tmp-" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
     ndn::shared_ptr<ndn::IdentityCertificate> cert = m_keyChain.getCertificate(m_keyChain.createIdentity(identity));
     m_faces[index] = ndn::make_shared<ndn::Face>(m_ioService);
     m_l[index] = new SyncLogic(ndn::Name("/bcast"), 
@@ -166,17 +167,17 @@
   ndn::shared_ptr<Handler> h1 = ndn::make_shared<Handler>("1");
   ndn::shared_ptr<Handler> h2 = ndn::make_shared<Handler>("2");
 
-  scheduler.scheduleEvent(ndn::time::seconds(0), ndn::bind(&TestCore::createSyncLogic, &testCore, 0, h1));
-  scheduler.scheduleEvent(ndn::time::seconds(0.1), ndn::bind(&TestCore::getOldDigestForOne, &testCore));
-  scheduler.scheduleEvent(ndn::time::seconds(0.2), ndn::bind(&TestCore::addLocalNamesForOne, &testCore, "/one", 1, 2));
-  scheduler.scheduleEvent(ndn::time::seconds(0.3), ndn::bind(&checkMapSize, h1, 0));
-  scheduler.scheduleEvent(ndn::time::seconds(0.4), ndn::bind(&TestCore::createSyncLogic, &testCore, 1, h2));
-  scheduler.scheduleEvent(ndn::time::seconds(0.5), ndn::bind(&checkMapSize, h1, 0));
-  scheduler.scheduleEvent(ndn::time::seconds(0.6), ndn::bind(&checkMapSize, h2, 1));
-  scheduler.scheduleEvent(ndn::time::seconds(0.7), ndn::bind(&TestCore::removeForOne, &testCore, "/one"));
-  scheduler.scheduleEvent(ndn::time::seconds(0.8), ndn::bind(&TestCore::getNewDigestForOne, &testCore));
-  scheduler.scheduleEvent(ndn::time::seconds(0.9), ndn::bind(&TestCore::checkDigest, &testCore));
-  scheduler.scheduleEvent(ndn::time::seconds(1.0), ndn::bind(&TestCore::finish, &testCore));
+  scheduler.scheduleEvent(ndn::time::milliseconds(0), ndn::bind(&TestCore::createSyncLogic, &testCore, 0, h1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(100), ndn::bind(&TestCore::getOldDigestForOne, &testCore));
+  scheduler.scheduleEvent(ndn::time::milliseconds(200), ndn::bind(&TestCore::addLocalNamesForOne, &testCore, "/one", 1, 2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(300), ndn::bind(&checkMapSize, h1, 0));
+  scheduler.scheduleEvent(ndn::time::milliseconds(400), ndn::bind(&TestCore::createSyncLogic, &testCore, 1, h2));
+  scheduler.scheduleEvent(ndn::time::milliseconds(500), ndn::bind(&checkMapSize, h1, 0));
+  scheduler.scheduleEvent(ndn::time::milliseconds(600), ndn::bind(&checkMapSize, h2, 1));
+  scheduler.scheduleEvent(ndn::time::milliseconds(700), ndn::bind(&TestCore::removeForOne, &testCore, "/one"));
+  scheduler.scheduleEvent(ndn::time::milliseconds(800), ndn::bind(&TestCore::getNewDigestForOne, &testCore));
+  scheduler.scheduleEvent(ndn::time::milliseconds(900), ndn::bind(&TestCore::checkDigest, &testCore));
+  scheduler.scheduleEvent(ndn::time::milliseconds(1000), ndn::bind(&TestCore::finish, &testCore, ioService));
   
   ioService->run();
 
diff --git a/tests/test-sync-validator.cc b/tests/test-sync-validator.cc
index 9049edc..6f77f86 100644
--- a/tests/test-sync-validator.cc
+++ b/tests/test-sync-validator.cc
@@ -47,23 +47,23 @@
   Name prefix("/Sync/TestSyncValidator/AddEdge");
   KeyChain keychain;
 
-  Name identity1("/TestSyncValidator/AddEdge-1/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity1("/TestSyncValidator/AddEdge-1/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName1 = keychain.createIdentity(identity1);
   shared_ptr<IdentityCertificate> anchor = keychain.getCertificate(certName1);
 
-  Name identity2("/TestSyncValidator/AddEdge-2/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity2("/TestSyncValidator/AddEdge-2/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName2 = keychain.createIdentity(identity2);
   shared_ptr<IdentityCertificate> introducer = keychain.getCertificate(certName2);
 
-  Name identity3("/TestSyncValidator/AddEdge-3/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity3("/TestSyncValidator/AddEdge-3/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName3 = keychain.createIdentity(identity3);
   shared_ptr<IdentityCertificate> introducee = keychain.getCertificate(certName3);
 
-  Name identity4("/TestSyncValidator/AddEdge-4/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity4("/TestSyncValidator/AddEdge-4/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName4 = keychain.createIdentity(identity4);
   shared_ptr<IdentityCertificate> introducer2 = keychain.getCertificate(certName4);
 
-  Name identity5("/TestSyncValidator/AddEdge-5/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity5("/TestSyncValidator/AddEdge-5/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName5 = keychain.createIdentity(identity5);
   shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName5);
 
@@ -125,23 +125,28 @@
   Name prefix("/Sync/TestSyncValidator/OfflineValidate");
   KeyChain keychain;
 
-  Name identity1("/TestSyncValidator/OfflineValidate-1/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity1("/TestSyncValidator/OfflineValidate-1/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName1 = keychain.createIdentity(identity1);
   shared_ptr<IdentityCertificate> anchor = keychain.getCertificate(certName1);
 
-  Name identity2("/TestSyncValidator/OfflineValidate-2/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity2("/TestSyncValidator/OfflineValidate-2/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName2 = keychain.createIdentity(identity2);
   shared_ptr<IdentityCertificate> introducer = keychain.getCertificate(certName2);
 
-  Name identity3("/TestSyncValidator/OfflineValidate-3/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity3("/TestSyncValidator/OfflineValidate-3/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName3 = keychain.createIdentity(identity3);
   shared_ptr<IdentityCertificate> introducee = keychain.getCertificate(certName3);
 
-  Name identity4("/TestSyncValidator/OfflineValidate-4/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity4("/TestSyncValidator/OfflineValidate-4/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName4 = keychain.createIdentity(identity4);
   shared_ptr<IdentityCertificate> introducer2 = keychain.getCertificate(certName4);
 
-  Name identity5("/TestSyncValidator/OfflineValidate-5/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity5("/TestSyncValidator/OfflineValidate-5/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName5 = keychain.createIdentity(identity5);
   shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName5);
 
@@ -191,7 +196,7 @@
 		     bind(&onValidated2, _1),
 		     bind(&onValidationFailed2, _1, _2));
 
-  ioService->run();
+  // ioService->run();
 
   keychain.deleteIdentity(identity1);
   keychain.deleteIdentity(identity2);
@@ -200,7 +205,55 @@
   keychain.deleteIdentity(identity5);
 }
 
-BOOST_AUTO_TEST_CASE (OnlineValidate)
+struct FacesFixture
+{
+  FacesFixture()
+    : regPrefixId(0)
+    , regPrefixId2(0)
+  {}
+  
+  void
+  onInterest(ndn::shared_ptr<ndn::Face> face, ndn::shared_ptr<ndn::Data> data)
+  {
+    face->put(*data);
+    face->unsetInterestFilter(regPrefixId);
+  }
+
+  void
+  onInterest2(ndn::shared_ptr<ndn::Face> face, ndn::shared_ptr<ndn::Data> data)
+  {
+    face->put(*data);
+    face->unsetInterestFilter(regPrefixId2);
+  }
+
+  void
+  onRegFailed()
+  {}
+
+  void
+  validate(ndn::shared_ptr<Sync::SyncValidator> validator, ndn::shared_ptr<ndn::Data> data, 
+           const ndn::Name& certName3, const ndn::Name& certName4)
+  {
+    validator->validate(*data,
+                        bind(&onValidated, _1),
+                        bind(&onValidationFailed, _1, _2));
+
+
+    BOOST_CHECK(validator->canTrust(certName3));
+    BOOST_CHECK(validator->canTrust(certName4));
+  }
+
+  void
+  terminate(ndn::shared_ptr<ndn::Face> face)
+  {
+    face->ioService()->stop();
+  }
+
+  const ndn::RegisteredPrefixId* regPrefixId;
+  const ndn::RegisteredPrefixId* regPrefixId2;
+};
+
+BOOST_FIXTURE_TEST_CASE(OnlineValidate, FacesFixture)
 {
   using namespace Sync;
   using namespace ndn;
@@ -208,55 +261,66 @@
   Name prefix("/Sync/TestSyncValidator/OnlineValidate");
   KeyChain keychain;
 
-  Name identity1("/TestSyncValidator/OnlineValidate-1/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity1("/TestSyncValidator/OnlineValidate-1/" 
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName1 = keychain.createIdentity(identity1);
   shared_ptr<IdentityCertificate> anchor = keychain.getCertificate(certName1);
 
-  Name identity2("/TestSyncValidator/OnlineValidate-2/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity2("/TestSyncValidator/OnlineValidate-2/" 
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName2 = keychain.createIdentity(identity2);
   shared_ptr<IdentityCertificate> introducer = keychain.getCertificate(certName2);
 
-  Name identity3("/TestSyncValidator/OnlineValidate-3/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity3("/TestSyncValidator/OnlineValidate-3/" 
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName3 = keychain.createIdentity(identity3);
   shared_ptr<IdentityCertificate> introducee = keychain.getCertificate(certName3);
 
-  Name identity4("/TestSyncValidator/OfflineValidate-4/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity4("/TestSyncValidator/OnlineValidate-4/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName4 = keychain.createIdentity(identity4);
   shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName4);
 
   shared_ptr<boost::asio::io_service> ioService = make_shared<boost::asio::io_service>();
   shared_ptr<Face> face = make_shared<Face>(ioService);
+  shared_ptr<Face> face2 = make_shared<Face>(ioService);
+
   shared_ptr<SecRuleRelative> rule;
-  SyncValidator validator(prefix, *anchor, face,
-                          bind(&publishData, _1, _2, _3),
-                          rule);
+  shared_ptr<SyncValidator> validator = shared_ptr<SyncValidator>
+    (new SyncValidator(prefix, *anchor, face2, bind(&publishData, _1, _2, _3), rule));
 
-  validator.addParticipant(*introducer);
-  BOOST_CHECK(validator.canTrust(certName2));
+  validator->addParticipant(*introducer);
+  BOOST_CHECK(validator->canTrust(certName2));
   
-  IntroCertificate introCert(prefix, *introducee, certName2.getPrefix(-1));
-  keychain.sign(introCert, certName2);
-  face->put(introCert);
-  BOOST_CHECK(validator.canTrust(certName3) == false);
+  shared_ptr<IntroCertificate> introCert = shared_ptr<IntroCertificate>(new IntroCertificate(prefix, *introducee, certName2.getPrefix(-1)));
+  keychain.sign(*introCert, certName2);
+  BOOST_CHECK(validator->canTrust(certName3) == false);
 
-  IntroCertificate introCert2(prefix, *introducee2, certName3.getPrefix(-1));
-  keychain.sign(introCert2, certName3);
-  face->put(introCert2);
-  BOOST_CHECK(validator.canTrust(certName4) == false);
+  shared_ptr<IntroCertificate> introCert2 = shared_ptr<IntroCertificate>(new IntroCertificate(prefix, *introducee2, certName3.getPrefix(-1)));
+  keychain.sign(*introCert2, certName3);
+  BOOST_CHECK(validator->canTrust(certName4) == false);
 
   Name dataName1 = prefix;
   dataName1.append("data-1");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
   keychain.sign(*data1, certName4);
 
-  validator.validate(*data1,
-		     bind(&onValidated, _1),
-		     bind(&onValidationFailed, _1, _2));
+  ndn::Scheduler scheduler(*ioService);
 
-  ioService->run();
+  scheduler.scheduleEvent(time::seconds(1),
+                          bind(&FacesFixture::terminate, this, face));
 
-  BOOST_CHECK(validator.canTrust(certName3));
-  BOOST_CHECK(validator.canTrust(certName4));
+  regPrefixId = face->setInterestFilter(introCert->getName().getPrefix(-1),
+                                       bind(&FacesFixture::onInterest, this, face, introCert),
+                                       bind(&FacesFixture::onRegFailed, this));
+  
+  regPrefixId2 = face->setInterestFilter(introCert2->getName().getPrefix(-1),
+					bind(&FacesFixture::onInterest2, this, face, introCert2),
+					bind(&FacesFixture::onRegFailed, this));
+
+  scheduler.scheduleEvent(time::milliseconds(200),
+                          bind(&FacesFixture::validate, this,
+			       validator, data1, certName3, certName4));
 
   keychain.deleteIdentity(identity1);
   keychain.deleteIdentity(identity2);
