diff --git a/debug-tools/create-cert.cc b/debug-tools/create-cert.cc
index 282c07e..09861d3 100644
--- a/debug-tools/create-cert.cc
+++ b/debug-tools/create-cert.cc
@@ -5,25 +5,25 @@
  * See COPYING for copyright and distribution information.
  */
 
-#include <ndn-cpp-dev/security/key-chain.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
 
 using namespace ndn;
 
-int 
+int
 main()
 {
-  KeyChainImpl<SecPublicInfoSqlite3, SecTpmFile> keyChain;
+  KeyChain keyChain("sqlite3", "file");
   std::vector<CertificateSubjectDescription> subjectDescription;
 
   Name root("/ndn");
   Name rootCertName = keyChain.createIdentity(root);
 
   Name test("/ndn/test");
-  Name testKeyName = keyChain.generateRSAKeyPairAsDefault(test, true);
-  shared_ptr<IdentityCertificate> testCert = 
-    keyChain.prepareUnsignedIdentityCertificate(testKeyName, root, 
+  Name testKeyName = keyChain.generateRsaKeyPairAsDefault(test, true);
+  shared_ptr<IdentityCertificate> testCert =
+    keyChain.prepareUnsignedIdentityCertificate(testKeyName, root,
                                                 time::system_clock::now(),
-                                                time::system_clock::now() + time::days(7300), 
+                                                time::system_clock::now() + time::days(7300),
                                                 subjectDescription);
   keyChain.signByIdentity(*testCert, root);
   keyChain.addCertificateAsIdentityDefault(*testCert);
@@ -31,11 +31,11 @@
   Name alice("/ndn/test/alice");
   if(!keyChain.doesIdentityExist(alice))
     {
-      Name aliceKeyName = keyChain.generateRSAKeyPairAsDefault(alice, true);
-      shared_ptr<IdentityCertificate> aliceCert = 
-	keyChain.prepareUnsignedIdentityCertificate(aliceKeyName, test, 
+      Name aliceKeyName = keyChain.generateRsaKeyPairAsDefault(alice, true);
+      shared_ptr<IdentityCertificate> aliceCert =
+        keyChain.prepareUnsignedIdentityCertificate(aliceKeyName, test,
                                                     time::system_clock::now(),
-                                                    time::system_clock::now() + time::days(7300), 
+                                                    time::system_clock::now() + time::days(7300),
                                                     subjectDescription);
       keyChain.signByIdentity(*aliceCert, test);
       keyChain.addCertificateAsIdentityDefault(*aliceCert);
@@ -44,9 +44,12 @@
   Name bob("/ndn/test/bob");
   if(!keyChain.doesIdentityExist(bob))
     {
-      Name bobKeyName = keyChain.generateRSAKeyPairAsDefault(bob, true);
-      shared_ptr<IdentityCertificate> bobCert = 
-	keyChain.prepareUnsignedIdentityCertificate(bobKeyName, test, getNow(), getNow() + 630720000, subjectDescription);
+      Name bobKeyName = keyChain.generateRsaKeyPairAsDefault(bob, true);
+      shared_ptr<IdentityCertificate> bobCert =
+        keyChain.prepareUnsignedIdentityCertificate(bobKeyName, test,
+                                                    time::system_clock::now(),
+                                                    time::system_clock::now() + time::days(7300),
+                                                    subjectDescription);
       keyChain.signByIdentity(*bobCert, test);
       keyChain.addCertificateAsIdentityDefault(*bobCert);
     }
@@ -54,9 +57,12 @@
   Name cathy("/ndn/test/cathy");
   if(!keyChain.doesIdentityExist(cathy))
     {
-      Name cathyKeyName = keyChain.generateRSAKeyPairAsDefault(cathy, true);
-      shared_ptr<IdentityCertificate> cathyCert = 
-	keyChain.prepareUnsignedIdentityCertificate(cathyKeyName, test, getNow(), getNow() + 630720000, subjectDescription);
+      Name cathyKeyName = keyChain.generateRsaKeyPairAsDefault(cathy, true);
+      shared_ptr<IdentityCertificate> cathyCert =
+        keyChain.prepareUnsignedIdentityCertificate(cathyKeyName, test,
+                                                    time::system_clock::now(),
+                                                    time::system_clock::now() + time::days(7300),
+                                                    subjectDescription);
       keyChain.signByIdentity(*cathyCert, test);
       keyChain.addCertificateAsIdentityDefault(*cathyCert);
     }
diff --git a/debug-tools/dump-cert.cc b/debug-tools/dump-cert.cc
index 6022940..7050175 100644
--- a/debug-tools/dump-cert.cc
+++ b/debug-tools/dump-cert.cc
@@ -5,12 +5,13 @@
  * See COPYING for copyright and distribution information.
  */
 
-#include <ndn-cpp-dev/security/key-chain.hpp>
-#include <ndn-cpp-dev/face.hpp>
+#include "common.hpp"
+#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/face.hpp>
 
 using namespace ndn;
 
-int 
+int
 main()
 {
   Name root("/ndn");
@@ -19,23 +20,21 @@
   Name bob("/ndn/test/bob");
   Name cathy("/ndn/test/cathy");
 
-  KeyChainImpl<SecPublicInfoSqlite3, SecTpmFile> keyChain;
+  KeyChain keyChain("sqlite3", "file");
 
-  if(!keyChain.doesIdentityExist(root)
-     || !keyChain.doesIdentityExist(test)
-     || !keyChain.doesIdentityExist(alice)
-     || !keyChain.doesIdentityExist(bob)
-     || !keyChain.doesIdentityExist(cathy))
+  if (!keyChain.doesIdentityExist(root) ||
+      !keyChain.doesIdentityExist(test) ||
+      !keyChain.doesIdentityExist(alice) ||
+      !keyChain.doesIdentityExist(bob) ||
+      !keyChain.doesIdentityExist(cathy))
     return 1;
 
-  shared_ptr<boost::asio::io_service> ioService = make_shared<boost::asio::io_service>();
-  shared_ptr<Face> face = shared_ptr<Face>(new Face(ioService));
-  // shared_ptr<Face> face = make_shared<Face>();
-  
-  face->put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(test)));
-  face->put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(alice)));
-  face->put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(bob)));
-  face->put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(cathy)));
+  Face face;
 
-  ioService->run();
+  face.put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(test)));
+  face.put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(alice)));
+  face.put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(bob)));
+  face.put(*keyChain.getCertificate(keyChain.getDefaultCertificateNameForIdentity(cathy)));
+
+  face.getIoService().run();
 }
diff --git a/debug-tools/dump-local-prefix.cc b/debug-tools/dump-local-prefix.cc
index ba67ac4..7f3af3f 100644
--- a/debug-tools/dump-local-prefix.cc
+++ b/debug-tools/dump-local-prefix.cc
@@ -5,23 +5,23 @@
  * See COPYING for copyright and distribution information.
  */
 
-#include <ndn-cpp-dev/security/key-chain.hpp>
-#include <ndn-cpp-dev/face.hpp>
+#include "common.hpp"
+#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/face.hpp>
 
 using namespace ndn;
 
-int 
+int
 main()
 {
   Name root("/ndn");
 
-  KeyChainImpl<SecPublicInfoSqlite3, SecTpmFile> keyChain;
+  KeyChain keyChain("sqlite3", "file");
 
   if(!keyChain.doesIdentityExist(root))
     return 1;
 
-  shared_ptr<boost::asio::io_service> ioService = make_shared<boost::asio::io_service>();
-  shared_ptr<Face> face = shared_ptr<Face>(new Face(ioService));
+  Face face;
 
   Name name("/local/ndn/prefix");
   name.appendVersion().appendSegment(0);
@@ -30,8 +30,8 @@
   std::string prefix("/ndn/test");
   data.setContent(reinterpret_cast<const uint8_t*>(prefix.c_str()), prefix.size());
   keyChain.signByIdentity(data, root);
-  
-  face->put(data);
 
-  ioService->run();
+  face.put(data);
+
+  face.getIoService().run();
 }
