diff --git a/tests/face/tcp.cpp b/tests/face/tcp.cpp
index 5990ab4..cba8796 100644
--- a/tests/face/tcp.cpp
+++ b/tests/face/tcp.cpp
@@ -17,8 +17,7 @@
 
 BOOST_AUTO_TEST_CASE(ChannelMap)
 {
-  boost::asio::io_service io;
-  TcpChannelFactory factory(io);
+  TcpChannelFactory factory;
   
   shared_ptr<TcpChannel> channel1 = factory.create("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel1a = factory.create("127.0.0.1", "20070");
@@ -147,7 +146,7 @@
   void
   abortTestCase(const std::string& message)
   {
-    m_ioService.stop();
+    g_io.stop();
     BOOST_FAIL(message);
   }
   
@@ -155,12 +154,11 @@
   void
   afterIo()
   {
-    if (--m_ioRemaining <= 0) m_ioService.stop();
+    if (--m_ioRemaining <= 0)
+      g_io.stop();
   }
 
 public:
-  boost::asio::io_service m_ioService;
-
   int m_ioRemaining;
 
   shared_ptr<Face> m_face1;
@@ -176,13 +174,12 @@
 
 BOOST_FIXTURE_TEST_CASE(EndToEnd, EndToEndFixture)
 {
-  TcpChannelFactory factory(m_ioService);
-  Scheduler scheduler(m_ioService); // to limit the amount of time the test may take
+  TcpChannelFactory factory;
 
   EventId abortEvent =
-    scheduler.scheduleEvent(time::seconds(10),
-                            bind(&EndToEndFixture::abortTestCase, this,
-                                 "TcpChannel error: cannot connect or cannot accept connection"));
+    scheduler::schedule(time::seconds(10),
+                        bind(&EndToEndFixture::abortTestCase, this,
+                             "TcpChannel error: cannot connect or cannot accept connection"));
   
   shared_ptr<TcpChannel> channel1 = factory.create("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel2 = factory.create("127.0.0.1", "20071");
@@ -196,9 +193,9 @@
                     time::seconds(4));
 
   m_ioRemaining = 2;
-  m_ioService.run();
-  m_ioService.reset();
-  scheduler.cancelEvent(abortEvent);
+  g_io.run();
+  g_io.reset();
+  scheduler::cancel(abortEvent);
 
   BOOST_REQUIRE(static_cast<bool>(m_face1));
   BOOST_REQUIRE(static_cast<bool>(m_face2));
@@ -212,9 +209,9 @@
   // integrated tests needs to check that TcpFace for non-loopback fails these tests...
   
   abortEvent =
-    scheduler.scheduleEvent(time::seconds(10),
-                            bind(&EndToEndFixture::abortTestCase, this,
-                                 "TcpChannel error: cannot send or receive Interest/Data packets"));
+    scheduler::schedule(time::seconds(10),
+                        bind(&EndToEndFixture::abortTestCase, this,
+                             "TcpChannel error: cannot send or receive Interest/Data packets"));
 
   Interest interest1("ndn:/TpnzGvW9R");
   Data     data1    ("ndn:/KfczhUqVix");
@@ -236,8 +233,9 @@
   m_face2->sendData    (data2    );
 
   m_ioRemaining = 4;
-  m_ioService.run();
-  m_ioService.reset();
+  g_io.run();
+  g_io.reset();
+  scheduler::cancel(abortEvent);
 
   BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
   BOOST_REQUIRE_EQUAL(m_face1_receivedDatas    .size(), 1);
@@ -252,13 +250,12 @@
 
 BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
 {
-  TcpChannelFactory factory(m_ioService);
-  Scheduler scheduler(m_ioService); // to limit the amount of time the test may take
+  TcpChannelFactory factory;
 
   EventId abortEvent =
-    scheduler.scheduleEvent(time::seconds(10),
-                            bind(&EndToEndFixture::abortTestCase, this,
-                                 "TcpChannel error: cannot connect or cannot accept connection"));
+    scheduler::schedule(time::seconds(10),
+                        bind(&EndToEndFixture::abortTestCase, this,
+                             "TcpChannel error: cannot connect or cannot accept connection"));
   
   shared_ptr<TcpChannel> channel1 = factory.create("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel2 = factory.create("127.0.0.1", "20071");
@@ -272,9 +269,9 @@
                     time::seconds(4)); // very short timeout
 
   m_ioRemaining = 2;
-  m_ioService.run();
-  m_ioService.reset();
-  scheduler.cancelEvent(abortEvent);
+  g_io.run();
+  g_io.reset();
+  scheduler::cancel(abortEvent);
 
   BOOST_CHECK_EQUAL(m_faces.size(), 2);
   
@@ -290,7 +287,7 @@
   BOOST_CHECK_NE(channel3, channel4);
   
   scheduler
-    .scheduleEvent
+    ::schedule
     (time::seconds(1),
      bind(&TcpChannel::connect, channel4,
           "127.0.0.1", "20070",
@@ -303,29 +300,29 @@
   
   m_ioRemaining = 4; // 2 connects and 2 accepts
   abortEvent = 
-    scheduler.scheduleEvent(time::seconds(10),
-                            bind(&EndToEndFixture::abortTestCase, this,
-                                 "TcpChannel error: cannot connect or cannot accept multiple connections"));
+    scheduler::schedule(time::seconds(10),
+                        bind(&EndToEndFixture::abortTestCase, this,
+                             "TcpChannel error: cannot connect or cannot accept multiple connections"));
 
-  scheduler.scheduleEvent(time::seconds(0.5),
-                          bind(&EndToEndFixture::checkFaceList, this, 4));
+  scheduler::schedule(time::seconds(0.5),
+                      bind(&EndToEndFixture::checkFaceList, this, 4));
   
-  m_ioService.run();
-  m_ioService.reset();
-  
+  g_io.run();
+  g_io.reset();
+  scheduler::cancel(abortEvent);
+
   BOOST_CHECK_EQUAL(m_faces.size(), 6);
 }
 
 
 BOOST_FIXTURE_TEST_CASE(FaceClosing, EndToEndFixture)
 {
-  TcpChannelFactory factory(m_ioService);
-  Scheduler scheduler(m_ioService); // to limit the amount of time the test may take
+  TcpChannelFactory factory;
 
   EventId abortEvent =
-    scheduler.scheduleEvent(time::seconds(10),
-                            bind(&EndToEndFixture::abortTestCase, this,
-                                 "TcpChannel error: cannot connect or cannot accept connection"));
+    scheduler::schedule(time::seconds(10),
+                        bind(&EndToEndFixture::abortTestCase, this,
+                             "TcpChannel error: cannot connect or cannot accept connection"));
   
   shared_ptr<TcpChannel> channel1 = factory.create("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel2 = factory.create("127.0.0.1", "20071");
@@ -339,17 +336,18 @@
                     time::seconds(4)); // very short timeout
 
   m_ioRemaining = 2;
-  BOOST_REQUIRE_NO_THROW(m_ioService.run());
-  m_ioService.reset();
-  scheduler.cancelEvent(abortEvent);
+  g_io.run();
+  // BOOST_REQUIRE_NO_THROW(g_io.run());
+  g_io.reset();
+  scheduler::cancel(abortEvent);
 
   BOOST_CHECK_EQUAL(channel1->size(), 1);
   BOOST_CHECK_EQUAL(channel2->size(), 1);
 
   abortEvent =
-    scheduler.scheduleEvent(time::seconds(10),
-                            bind(&EndToEndFixture::abortTestCase, this,
-                                 "FaceClosing error: cannot properly close faces"));
+    scheduler::schedule(time::seconds(10),
+                        bind(&EndToEndFixture::abortTestCase, this,
+                             "FaceClosing error: cannot properly close faces"));
 
   BOOST_REQUIRE(static_cast<bool>(m_face1));
   BOOST_CHECK(static_cast<bool>(m_face2));
@@ -358,9 +356,9 @@
   // just double check that we are calling the virtual method
   static_pointer_cast<Face>(m_face1)->close();
   
-  BOOST_REQUIRE_NO_THROW(m_ioService.run());
-  m_ioService.reset();
-  scheduler.cancelEvent(abortEvent);
+  BOOST_REQUIRE_NO_THROW(g_io.run());
+  g_io.reset();
+  scheduler::cancel(abortEvent);
 
   // both faces should get closed
   BOOST_CHECK(!static_cast<bool>(m_face1));
