diff --git a/tests/test-get-async.cpp b/tests/test-get-async.cpp
index 60b02b5..76ae5c1 100644
--- a/tests/test-get-async.cpp
+++ b/tests/test-get-async.cpp
@@ -14,42 +14,54 @@
 using namespace ndn;
 using namespace ptr_lib;
 
-static int CallbackCount = 0;
-
-void myOnData(const ptr_lib::shared_ptr<const Interest> &interest, const ptr_lib::shared_ptr<Data> &data)
+class Counter
 {
-  ++CallbackCount;
-  cout << "Got data packet with name " << data->getName().to_uri() << endl;
-  for (unsigned int i = 0; i < data->getContent().size(); ++i)
-    cout << data->getContent()[i];
-  cout << endl;  
-}
+public:
+  Counter() {
+    callbackCount_ = 0;
+  }
+  
+  void onData(const ptr_lib::shared_ptr<const Interest> &interest, const ptr_lib::shared_ptr<Data> &data)
+  {
+    ++callbackCount_;
+    cout << "Got data packet with name " << data->getName().to_uri() << endl;
+    for (unsigned int i = 0; i < data->getContent().size(); ++i)
+      cout << data->getContent()[i];
+    cout << endl;  
+  }
 
-void myOnTimeout(const ptr_lib::shared_ptr<const Interest> &interest)
-{
-  ++CallbackCount;
-  cout << "Time out for interest " << interest->getName().toUri() << endl;    
-}
+  void onTimeout(const ptr_lib::shared_ptr<const Interest> &interest)
+  {
+    ++callbackCount_;
+    cout << "Time out for interest " << interest->getName().toUri() << endl;    
+  }
+  
+  int callbackCount_;
+};
 
 int main(int argc, char** argv)
 {
   try {
     Face face("E.hub.ndn.ucla.edu");
     
+    // Counter holds data used by the callbacks.
+    Counter counter;
+    
     Name name1("/ndn/ucla.edu/apps/ndn-js-test/hello.txt/level2/%FD%05%0B%16%7D%95%0E");    
     cout << "Express name  " << name1.toUri() << endl;
-    face.expressInterest(name1, myOnData, myOnTimeout);
+    // Use bind to pass the counter object to the callbacks.
+    face.expressInterest(name1, bind(&Counter::onData, &counter, _1, _2), bind(&Counter::onTimeout, &counter, _1));
     
     Name name2("/ndn/ucla.edu/apps/lwndn-test/howdy.txt/%FD%05%05%E8%0C%CE%1D");
     cout << "Express name  " << name2.toUri() << endl;
-    face.expressInterest(name2, myOnData, myOnTimeout);
+    face.expressInterest(name2, bind(&Counter::onData, &counter, _1, _2), bind(&Counter::onTimeout, &counter, _1));
     
     Name name3("/test/timeout");
     cout << "Express name  " << name3.toUri() << endl;
-    face.expressInterest(name3, myOnData, myOnTimeout);
+    face.expressInterest(name3, bind(&Counter::onData, &counter, _1, _2), bind(&Counter::onTimeout, &counter, _1));
 
     // The main event loop.
-    while (CallbackCount < 3) {
+    while (counter.callbackCount_ < 3) {
       face.processEvents();
       // We need to sleep for a few milliseconds so we don't use 100% of the CPU.
       usleep(10000);
