diff --git a/tests/core/scheduler.cpp b/tests/core/scheduler.cpp
index 77ca1e9..d6b51fa 100644
--- a/tests/core/scheduler.cpp
+++ b/tests/core/scheduler.cpp
@@ -21,7 +21,7 @@
     , count4(0)
   {
   }
-    
+
   void
   event1()
   {
@@ -47,7 +47,7 @@
   {
     ++count4;
   }
-  
+
   int count1;
   int count2;
   int count3;
@@ -56,23 +56,23 @@
 
 BOOST_FIXTURE_TEST_CASE(Events, SchedulerFixture)
 {
-  boost::asio::io_service io; 
+  resetGlobalIoService();
 
-  Scheduler scheduler(io);
-  scheduler.scheduleEvent(time::seconds(0.5), bind(&SchedulerFixture::event1, this));
-  
-  EventId i = scheduler.scheduleEvent(time::seconds(1.0), bind(&SchedulerFixture::event2, this));
-  scheduler.cancelEvent(i);
+  scheduler::schedule(time::seconds(0.5), bind(&SchedulerFixture::event1, this));
 
-  scheduler.scheduleEvent(time::seconds(0.25), bind(&SchedulerFixture::event3, this));
+  EventId i = scheduler::schedule(time::seconds(1.0), bind(&SchedulerFixture::event2, this));
+  scheduler::cancel(i);
 
-  i = scheduler.scheduleEvent(time::seconds(0.05), bind(&SchedulerFixture::event2, this));
-  scheduler.cancelEvent(i);
+  scheduler::schedule(time::seconds(0.25), bind(&SchedulerFixture::event3, this));
 
-  i = scheduler.schedulePeriodicEvent(time::seconds(0.3), time::seconds(0.1), bind(&SchedulerFixture::event4, this));
-  scheduler.scheduleEvent(time::seconds(1), bind(&Scheduler::cancelEvent, &scheduler, i));
-  
-  io.run();
+  i = scheduler::schedule(time::seconds(0.05), bind(&SchedulerFixture::event2, this));
+  scheduler::cancel(i);
+
+  // TODO deprecate periodic event
+  i = scheduler::getGlobalScheduler().schedulePeriodicEvent(time::seconds(0.3), time::seconds(0.1), bind(&SchedulerFixture::event4, this));
+  scheduler::schedule(time::seconds(1), bind(&scheduler::cancel, i));
+
+  getGlobalIoService().run();
 
   BOOST_CHECK_EQUAL(count1, 1);
   BOOST_CHECK_EQUAL(count2, 0);
@@ -82,37 +82,29 @@
 
 BOOST_AUTO_TEST_CASE(CancelEmptyEvent)
 {
-  boost::asio::io_service io; 
-  Scheduler scheduler(io);
-  
   EventId i;
-  scheduler.cancelEvent(i);
+  scheduler::cancel(i);
 }
 
 struct SelfCancelFixture
 {
-  SelfCancelFixture()
-    : m_scheduler(m_io)
-  {
-  }
-  
   void
   cancelSelf()
   {
-    m_scheduler.cancelEvent(m_selfEventId);
+    scheduler::cancel(m_selfEventId);
   }
-  
-  boost::asio::io_service m_io; 
-  Scheduler m_scheduler;
+
   EventId m_selfEventId;
 };
 
 BOOST_FIXTURE_TEST_CASE(SelfCancel, SelfCancelFixture)
 {
-  m_selfEventId = m_scheduler.scheduleEvent(time::seconds(0.1),
-                                            bind(&SelfCancelFixture::cancelSelf, this));
-  
-  BOOST_REQUIRE_NO_THROW(m_io.run());
+  resetGlobalIoService();
+
+  m_selfEventId = scheduler::schedule(time::seconds(0.1),
+                                      bind(&SelfCancelFixture::cancelSelf, this));
+
+  BOOST_REQUIRE_NO_THROW(getGlobalIoService().run());
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/core/time.cpp b/tests/core/time.cpp
deleted file mode 100644
index 6d0db3f..0000000
--- a/tests/core/time.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (C) 2014 Named Data Networking Project
- * See COPYING for copyright and distribution information.
- */
-
-#include "core/time.hpp"
-
-#include <boost/test/unit_test.hpp>
-
-namespace nfd {
-
-BOOST_AUTO_TEST_SUITE(CoreTime)
-
-BOOST_AUTO_TEST_CASE(Now)
-{
-  time::Point p1 = time::now();
-  time::Point p2 = time::now();
-  BOOST_CHECK_LE(p1, p2);
-}
-
-BOOST_AUTO_TEST_CASE(Operations)
-{
-  // helpers
-  BOOST_CHECK_GT(time::seconds(1), time::milliseconds(1));
-  BOOST_CHECK_GT(time::milliseconds(1), time::microseconds(1));
-  BOOST_CHECK_GT(time::microseconds(1), time::nanoseconds(1));
-  
-  // duration operations + helpers
-  BOOST_CHECK_EQUAL(time::seconds(8) + time::microseconds(101), time::nanoseconds(8000101000));
-  BOOST_CHECK_EQUAL(time::seconds(7) - time::milliseconds(234), time::microseconds(6766000));
-
-  // point operations
-  time::Point p1 = time::now();
-  time::Point p2 = p1 + time::milliseconds(10000);
-  time::Point p3 = p2 - time::microseconds(5000000);
-  BOOST_CHECK_LE(p1, p2);
-  BOOST_CHECK_LE(p1, p3);
-  BOOST_CHECK_LE(p3, p2);
-  
-  BOOST_CHECK_EQUAL(p2 - p1, time::seconds(10));
-  BOOST_CHECK_EQUAL(p3 - p1, time::seconds(5));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace nfd
