diff --git a/src/chatdialog.cpp b/src/chatdialog.cpp
index 0903b27..dad2b6b 100644
--- a/src/chatdialog.cpp
+++ b/src/chatdialog.cpp
@@ -87,6 +87,8 @@
   m_timer = new QTimer(this);
 
   startFace();
+  m_verifier = ndn::ptr_lib::make_shared<ndn::Verifier>(m_invitationPolicy);
+  m_verifier->setFace(m_face);
 
   ndn::Name certificateName = m_keyChain->getDefaultCertificateNameForIdentity(m_defaultIdentity);
   m_syncPolicy = ndn::ptr_lib::make_shared<SecPolicySync>(m_defaultIdentity, certificateName, m_chatroomPrefix, m_face);
@@ -222,60 +224,42 @@
                          const ndn::OnVerified& onVerified,
                          const ndn::OnVerifyFailed& onVerifyFailed,
                          const OnEventualTimeout& timeoutNotify,
-                         const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy,
-                         int retry /* = 1 */,
-                         int stepCount /* = 0 */)
+                         int retry /* = 1 */)
 {
   m_face->expressInterest(interest, 
                           boost::bind(&ChatDialog::onTargetData, 
                                       this,
                                       _1,
                                       _2,
-                                      stepCount,
                                       onVerified, 
-                                      onVerifyFailed,
-                                      timeoutNotify,
-                                      policy),
+                                      onVerifyFailed),
                           boost::bind(&ChatDialog::onTargetTimeout,
                                       this,
                                       _1,
                                       retry,
-                                      stepCount,
                                       onVerified,
                                       onVerifyFailed,
-                                      timeoutNotify,
-                                      policy));
+                                      timeoutNotify));
 }
 
 void
 ChatDialog::onTargetData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                          const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
-                         int stepCount,
                          const ndn::OnVerified& onVerified,
-                         const ndn::OnVerifyFailed& onVerifyFailed,
-                         const OnEventualTimeout& timeoutNotify,
-                         const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy)
+                         const ndn::OnVerifyFailed& onVerifyFailed)
 {
-  ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> nextStep = policy->checkVerificationPolicy(data, stepCount, onVerified, onVerifyFailed);
-
-  if (nextStep)
-    m_face->expressInterest
-      (*nextStep->interest_, 
-       boost::bind(&ChatDialog::onCertData, this, _1, _2, nextStep, policy), 
-       boost::bind(&ChatDialog::onCertTimeout, this, _1, onVerifyFailed, data, nextStep, policy));
+  m_verifier->verifyData(data, onVerified, onVerifyFailed);
 }
 
 void
 ChatDialog::onTargetTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                             int retry,
-                            int stepCount,
                             const ndn::OnVerified& onVerified,
                             const ndn::OnVerifyFailed& onVerifyFailed,
-                            const OnEventualTimeout& timeoutNotify,
-                            const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy)
+                            const OnEventualTimeout& timeoutNotify)
 {
   if(retry > 0)
-    sendInterest(*interest, onVerified, onVerifyFailed, timeoutNotify, policy, retry-1, stepCount);
+    sendInterest(*interest, onVerified, onVerifyFailed, timeoutNotify, retry-1);
   else
     {
       _LOG_DEBUG("Interest: " << interest->getName().toUri() << " eventually times out!");
@@ -284,50 +268,6 @@
 }
 
 void
-ChatDialog::onCertData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
-                       const ndn::ptr_lib::shared_ptr<ndn::Data>& cert,
-                       ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> previousStep,
-                       const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy)
-{
-  ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> nextStep = policy->checkVerificationPolicy(cert, 
-                                                                                                     previousStep->stepCount_, 
-                                                                                                     previousStep->onVerified_, 
-                                                                                                     previousStep->onVerifyFailed_);
-
-  if (nextStep)
-    m_face->expressInterest
-      (*nextStep->interest_, 
-       boost::bind(&ChatDialog::onCertData, this, _1, _2, nextStep, policy), 
-       boost::bind(&ChatDialog::onCertTimeout, this, _1, previousStep->onVerifyFailed_, cert, nextStep, policy));
-}
-
-void
-ChatDialog::onCertTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
-                          const ndn::OnVerifyFailed& onVerifyFailed,
-                          const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
-                          ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> nextStep,
-                          const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy)
-{
-  if(nextStep->retry_ > 0)
-    m_face->expressInterest(*interest, 
-                            boost::bind(&ChatDialog::onCertData,
-                                        this,
-                                        _1,
-                                        _2,
-                                        nextStep,
-                                        policy),
-                            boost::bind(&ChatDialog::onCertTimeout,
-                                        this,
-                                        _1,
-                                        onVerifyFailed,
-                                        data,
-                                        nextStep,
-                                        policy));
- else
-   onVerifyFailed(data);
-}
-
-void
 ChatDialog::sendInvitation(ndn::ptr_lib::shared_ptr<ContactItem> contact, bool isIntroducer)
 {
   m_invitationPolicy->addTrustAnchor(contact->getSelfEndorseCertificate());
@@ -370,7 +310,7 @@
                                                      contact->getNameSpace());
                                                  
 
-  sendInterest(interest, onVerified, onVerifyFailed, timeoutNotify, m_invitationPolicy);
+  sendInterest(interest, onVerified, onVerifyFailed, timeoutNotify);
 }
 
 void 
diff --git a/src/chatdialog.h b/src/chatdialog.h
index fad9ed4..bdcd070 100644
--- a/src/chatdialog.h
+++ b/src/chatdialog.h
@@ -148,42 +148,22 @@
   void
   onTargetData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
-               int stepCount,
                const ndn::OnVerified& onVerified,
-               const ndn::OnVerifyFailed& onVerifyFailed,
-               const OnEventualTimeout& timeoutNotify,
-               const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy);
+               const ndn::OnVerifyFailed& onVerifyFailed);
 
   void
   onTargetTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                   int retry,
-                  int stepCount,
                   const ndn::OnVerified& onVerified,
                   const ndn::OnVerifyFailed& onVerifyFailed,
-                  const OnEventualTimeout& timeoutNotify,
-                  const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy);
-  
-  void
-  onCertData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
-             const ndn::ptr_lib::shared_ptr<ndn::Data>& cert,
-             ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> previousStep,
-             const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy);
-
-  void
-  onCertTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
-                const ndn::OnVerifyFailed& onVerifyFailed,
-                const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
-                ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> nextStep,
-                const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy);
+                  const OnEventualTimeout& timeoutNotify);
 
   void
   sendInterest(const ndn::Interest& interest,
                const ndn::OnVerified& onVerified,
                const ndn::OnVerifyFailed& onVerifyFailed,
                const OnEventualTimeout& timeoutNotify,
-               const ndn::ptr_lib::shared_ptr<ndn::SecPolicy>& policy,
-               int retry = 1,
-               int stepCount = 0);
+               int retry = 1);
   
   void 
   onInviteReplyVerified(const ndn::ptr_lib::shared_ptr<ndn::Data>& data, 
@@ -343,6 +323,7 @@
   ndn::Name m_defaultIdentity;
   ndn::ptr_lib::shared_ptr<SecPolicyChronoChatInvitation> m_invitationPolicy;
   ndn::ptr_lib::shared_ptr<SecPolicySync> m_syncPolicy; 
+  ndn::ptr_lib::shared_ptr<ndn::Verifier> m_verifier;
   ndn::ptr_lib::shared_ptr<ndn::KeyChain> m_keyChain;
   ndn::ptr_lib::shared_ptr<ndn::Face> m_face;
 
diff --git a/src/contact-manager.cpp b/src/contact-manager.cpp
index aea34fc..a70be49 100644
--- a/src/contact-manager.cpp
+++ b/src/contact-manager.cpp
@@ -29,6 +29,7 @@
 #include <ndn-cpp/security/verifier.hpp>
 #include <cryptopp/base64.h>
 #include <ndn-cpp-et/policy/sec-rule-identity.hpp>
+#include <ndn-cpp-et/policy/sec-policy-simple.hpp>
 #include <fstream>
 #include "endorse-collection.pb.h"
 #include "logging.h"
@@ -59,31 +60,33 @@
 void
 ContactManager::initializeSecurity()
 {
-  m_policy = make_shared<SecPolicySimple>();
+  shared_ptr<SecPolicySimple> policy = make_shared<SecPolicySimple>();
+  m_verifier = make_shared<Verifier>(policy);
+  m_verifier->setFace(m_face);
 
-  m_policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<DNS>]*)<DNS><ENDORSED>",
-                                                                             "^([^<KEY>]*)<KEY>(<>*)[<ksk-.*><dsk-.*>]<ID-CERT>$",
-                                                                             "==", "\\1", "\\1\\2", true));
-  m_policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<DNS>]*)<DNS><PROFILE>",
-                                                                             "^([^<KEY>]*)<KEY>(<>*)[<ksk-.*><dsk-.*>]<ID-CERT>$",
-                                                                             "==", "\\1", "\\1\\2", true));
-  m_policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<PROFILE-CERT>]*)<PROFILE-CERT>",
-                                                                             "^([^<KEY>]*)<KEY>(<>*<ksk-.*>)<ID-CERT>$", 
-                                                                             "==", "\\1", "\\1\\2", true));
-  m_policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>",
-                                                                             "^([^<KEY>]*)<KEY><dsk-.*><ID-CERT>$",
-                                                                             ">", "\\1\\2", "\\1", true));
-  m_policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<KEY>]*)<KEY><dsk-.*><ID-CERT>",
-                                                                             "^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$",
-                                                                             "==", "\\1", "\\1\\2", true));
-  m_policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^(<>*)$", 
-                                                                             "^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$", 
-                                                                             ">", "\\1", "\\1\\2", true));
+  policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<DNS>]*)<DNS><ENDORSED>",
+                                                                 "^([^<KEY>]*)<KEY>(<>*)[<ksk-.*><dsk-.*>]<ID-CERT>$",
+                                                                 "==", "\\1", "\\1\\2", true));
+  policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<DNS>]*)<DNS><PROFILE>",
+                                                                 "^([^<KEY>]*)<KEY>(<>*)[<ksk-.*><dsk-.*>]<ID-CERT>$",
+                                                                 "==", "\\1", "\\1\\2", true));
+  policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<PROFILE-CERT>]*)<PROFILE-CERT>",
+                                                                 "^([^<KEY>]*)<KEY>(<>*<ksk-.*>)<ID-CERT>$", 
+                                                                 "==", "\\1", "\\1\\2", true));
+  policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>",
+                                                                 "^([^<KEY>]*)<KEY><dsk-.*><ID-CERT>$",
+                                                                 ">", "\\1\\2", "\\1", true));
+  policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^([^<KEY>]*)<KEY><dsk-.*><ID-CERT>",
+                                                                 "^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$",
+                                                                 "==", "\\1", "\\1\\2", true));
+  policy->addVerificationPolicyRule(make_shared<SecRuleIdentity>("^(<>*)$", 
+                                                                 "^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$", 
+                                                                 ">", "\\1", "\\1\\2", true));
   
 
-  m_policy->addSigningPolicyRule(make_shared<SecRuleIdentity>("^([^<DNS>]*)<DNS><PROFILE>",
-                                                                        "^([^<KEY>]*)<KEY>(<>*)<><ID-CERT>",
-                                                                        "==", "\\1", "\\1\\2", true));
+  policy->addSigningPolicyRule(make_shared<SecRuleIdentity>("^([^<DNS>]*)<DNS><PROFILE>",
+                                                            "^([^<KEY>]*)<KEY>(<>*)<><ID-CERT>",
+                                                            "==", "\\1", "\\1\\2", true));
 
 
   const string TrustAnchor("BIICqgOyEIWlKzDI2xX2hdq5Azheu9IVyewcV4uM7ylfh67Y8MIxF3tDCTx5JgEn\
@@ -112,7 +115,7 @@
   Data data;
   data.wireDecode(Block(reinterpret_cast<const uint8_t*>(decoded.c_str()), decoded.size()));
   shared_ptr<IdentityCertificate> anchor = make_shared<IdentityCertificate>(data);
-  m_policy->addTrustAnchor(anchor);  
+  policy->addTrustAnchor(anchor);  
 
 #ifdef _DEBUG
 
@@ -142,7 +145,7 @@
   Data data2;
   data2.wireDecode(Block(reinterpret_cast<const uint8_t*>(decoded.c_str()), decoded.size()));
   shared_ptr<IdentityCertificate>anchor2 = make_shared<IdentityCertificate>(data2);
-  m_policy->addTrustAnchor(anchor2);  
+  policy->addTrustAnchor(anchor2);  
 
 #endif
 }
@@ -310,31 +313,21 @@
 void
 ContactManager::onTargetData(const shared_ptr<const ndn::Interest>& interest, 
                              const shared_ptr<Data>& data,
-                             int stepCount,
                              const OnVerified& onVerified,
-                             const OnVerifyFailed& onVerifyFailed,
-                             const TimeoutNotify& timeoutNotify)
+                             const OnVerifyFailed& onVerifyFailed)
 {
-  shared_ptr<ValidationRequest> nextStep = m_policy->checkVerificationPolicy(data, stepCount, onVerified, onVerifyFailed);
-
-  if (nextStep)
-    m_face->expressInterest
-      (*nextStep->interest_, 
-       bind(&ContactManager::onCertData, this, _1, _2, nextStep), 
-       bind(&ContactManager::onCertTimeout, this, _1, onVerifyFailed, data, nextStep));
-
+  m_verifier->verifyData(data, onVerified, onVerifyFailed);
 }
 
 void
 ContactManager::onTargetTimeout(const shared_ptr<const ndn::Interest>& interest, 
                                 int retry,
-                                int stepCount,
                                 const OnVerified& onVerified,
                                 const OnVerifyFailed& onVerifyFailed,
                                 const TimeoutNotify& timeoutNotify)
 {
   if(retry > 0)
-    sendInterest(*interest, onVerified, onVerifyFailed, timeoutNotify, retry-1, stepCount);
+    sendInterest(*interest, onVerified, onVerifyFailed, timeoutNotify, retry-1);
   else
     {
       _LOG_DEBUG("Interest: " << interest->getName().toUri() << " eventually times out!");
@@ -343,67 +336,23 @@
 }
 
 void
-ContactManager::onCertData(const shared_ptr<const ndn::Interest>& interest, 
-                           const shared_ptr<Data>& cert,
-                           shared_ptr<ValidationRequest> previousStep)
-{
-  shared_ptr<ValidationRequest> nextStep = m_policy->checkVerificationPolicy(cert, 
-                                                                                    previousStep->stepCount_, 
-                                                                                    previousStep->onVerified_, 
-                                                                                    previousStep->onVerifyFailed_);
-
-  if (nextStep)
-    m_face->expressInterest
-      (*nextStep->interest_, 
-       bind(&ContactManager::onCertData, this, _1, _2, nextStep), 
-       bind(&ContactManager::onCertTimeout, this, _1, previousStep->onVerifyFailed_, cert, nextStep));
-}
-
-void
-ContactManager::onCertTimeout(const shared_ptr<const ndn::Interest>& interest,
-                              const OnVerifyFailed& onVerifyFailed,
-                              const shared_ptr<Data>& data,
-                              shared_ptr<ValidationRequest> nextStep)
-{
-  if(nextStep->retry_ > 0)
-    m_face->expressInterest(*interest, 
-                            bind(&ContactManager::onCertData,
-                                 this,
-                                 _1,
-                                 _2,
-                                 nextStep),
-                            bind(&ContactManager::onCertTimeout,
-                                 this,
-                                 _1,
-                                 onVerifyFailed,
-                                 data,
-                                 nextStep));
- else
-   onVerifyFailed(data);
-}
-
-void
 ContactManager::sendInterest(const Interest& interest,
                              const OnVerified& onVerified,
                              const OnVerifyFailed& onVerifyFailed,
                              const TimeoutNotify& timeoutNotify,
-                             int retry /* = 1 */,
-                             int stepCount /* = 0 */)
+                             int retry /* = 1 */)
 {
   uint64_t id = m_face->expressInterest(interest, 
                           boost::bind(&ContactManager::onTargetData, 
                                       this,
                                       _1,
                                       _2,
-                                      stepCount,
                                       onVerified, 
-                                      onVerifyFailed,
-                                      timeoutNotify),
+                                      onVerifyFailed),
                           boost::bind(&ContactManager::onTargetTimeout,
                                       this,
                                       _1,
                                       retry,
-                                      stepCount,
                                       onVerified,
                                       onVerifyFailed,
                                       timeoutNotify));
diff --git a/src/contact-manager.h b/src/contact-manager.h
index 67d4ac8..a188fdb 100644
--- a/src/contact-manager.h
+++ b/src/contact-manager.h
@@ -20,8 +20,7 @@
 #include "profile.h"
 #include <ndn-cpp/face.hpp>
 #include <ndn-cpp/security/key-chain.hpp>
-#include <ndn-cpp/security/validation-request.hpp>
-#include <ndn-cpp-et/policy/sec-policy-simple.hpp>
+#include <ndn-cpp/security/verifier.hpp>
 #endif
 
 typedef ndn::func_lib::function<void()> TimeoutNotify;
@@ -111,39 +110,23 @@
                const ndn::OnVerified& onVerified,
                const ndn::OnVerifyFailed& onVerifyFailed,
                const TimeoutNotify& timeoutNotify,
-               int retry = 1,
-               int stepCount = 0);
+               int retry = 1);
 
   void
   onTargetData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
-               int stepCount,
                const ndn::OnVerified& onVerified,
-               const ndn::OnVerifyFailed& onVerifyFailed,
-               const TimeoutNotify& timeoutNotify);
+               const ndn::OnVerifyFailed& onVerifyFailed);
 
   void
   onTargetTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                   int retry,
-                  int stepCount,
                   const ndn::OnVerified& onVerified,
                   const ndn::OnVerifyFailed& onVerifyFailed,
                   const TimeoutNotify& timeoutNotify);
 
 
   void
-  onCertData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
-             const ndn::ptr_lib::shared_ptr<ndn::Data>& cert,
-             ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> previousStep);
-
-  void
-  onCertTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
-                const ndn::OnVerifyFailed& onVerifyFailed,
-                const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
-                ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> nextStep);
-
-
-  void
   onDnsSelfEndorseCertificateTimeoutNotify(const ndn::Name& identity);
 
   void 
@@ -227,7 +210,7 @@
 
   ndn::ptr_lib::shared_ptr<ContactStorage> m_contactStorage;
   ndn::ptr_lib::shared_ptr<DnsStorage> m_dnsStorage;
-  ndn::ptr_lib::shared_ptr<ndn::SecPolicySimple> m_policy;
+  ndn::ptr_lib::shared_ptr<ndn::Verifier> m_verifier;
   ndn::ptr_lib::shared_ptr<ndn::KeyChain> m_keyChain;
   ndn::ptr_lib::shared_ptr<ndn::Face> m_face;
   ndn::Name m_defaultIdentity;
diff --git a/src/contactpanel.cpp b/src/contactpanel.cpp
index cde6c55..27978da 100644
--- a/src/contactpanel.cpp
+++ b/src/contactpanel.cpp
@@ -58,6 +58,8 @@
   createAction();
 
   m_keyChain = make_shared<KeyChain>();
+  m_verifier = make_shared<Verifier>(m_policy);
+  m_verifier->setFace(m_face);
 
   m_contactManager = make_shared<ContactManager>(m_keyChain, m_face);
 
@@ -340,23 +342,19 @@
                            const OnVerified& onVerified,
                            const OnVerifyFailed& onVerifyFailed,
                            const TimeoutNotify& timeoutNotify,
-                           int retry /* = 1 */,
-                           int stepCount /* = 0 */)
+                           int retry /* = 1 */)
 {
   m_face->expressInterest(interest, 
                           func_lib::bind(&ContactPanel::onTargetData, 
                                       this,
                                       _1,
                                       _2,
-                                      stepCount,
                                       onVerified, 
-                                      onVerifyFailed,
-                                      timeoutNotify),
+                                      onVerifyFailed),
                           func_lib::bind(&ContactPanel::onTargetTimeout,
                                       this,
                                       _1,
                                       retry,
-                                      stepCount,
                                       onVerified,
                                       onVerifyFailed,
                                       timeoutNotify));
@@ -365,31 +363,21 @@
 void
 ContactPanel::onTargetData(const shared_ptr<const ndn::Interest>& interest, 
                            const shared_ptr<Data>& data,
-                           int stepCount,
                            const OnVerified& onVerified,
-                           const OnVerifyFailed& onVerifyFailed,
-                           const TimeoutNotify& timeoutNotify)
+                           const OnVerifyFailed& onVerifyFailed)
 {
-  shared_ptr<ValidationRequest> nextStep = m_policy->checkVerificationPolicy(data, stepCount, onVerified, onVerifyFailed);
-
-  if (nextStep)
-    m_face->expressInterest
-      (*nextStep->interest_, 
-       func_lib::bind(&ContactPanel::onCertData, this, _1, _2, nextStep), 
-       func_lib::bind(&ContactPanel::onCertTimeout, this, _1, onVerifyFailed, data, nextStep));
-
+  m_verifier->verifyData(data, onVerified, onVerifyFailed);
 }
 
 void
 ContactPanel::onTargetTimeout(const shared_ptr<const ndn::Interest>& interest, 
                               int retry,
-                              int stepCount,
                               const OnVerified& onVerified,
                               const OnVerifyFailed& onVerifyFailed,
                               const TimeoutNotify& timeoutNotify)
 {
   if(retry > 0)
-    sendInterest(*interest, onVerified, onVerifyFailed, timeoutNotify, retry-1, stepCount);
+    sendInterest(*interest, onVerified, onVerifyFailed, timeoutNotify, retry-1);
   else
     {
       _LOG_DEBUG("Interest: " << interest->getName().toUri() << " eventually times out!");
@@ -398,46 +386,6 @@
 }
 
 void
-ContactPanel::onCertData(const shared_ptr<const ndn::Interest>& interest, 
-                         const shared_ptr<Data>& cert,
-                         shared_ptr<ValidationRequest> previousStep)
-{
-  shared_ptr<ValidationRequest> nextStep = m_policy->checkVerificationPolicy(cert, 
-                                                                                    previousStep->stepCount_, 
-                                                                                    previousStep->onVerified_, 
-                                                                                    previousStep->onVerifyFailed_);
-
-  if (nextStep)
-    m_face->expressInterest
-      (*nextStep->interest_, 
-       func_lib::bind(&ContactPanel::onCertData, this, _1, _2, nextStep), 
-       func_lib::bind(&ContactPanel::onCertTimeout, this, _1, previousStep->onVerifyFailed_, cert, nextStep));
-}
-
-void
-ContactPanel::onCertTimeout(const shared_ptr<const ndn::Interest>& interest,
-                            const OnVerifyFailed& onVerifyFailed,
-                            const shared_ptr<Data>& data,
-                            shared_ptr<ValidationRequest> nextStep)
-{
-  if(nextStep->retry_ > 0)
-    m_face->expressInterest(*interest, 
-                            func_lib::bind(&ContactPanel::onCertData,
-                                 this,
-                                 _1,
-                                 _2,
-                                 nextStep),
-                            func_lib::bind(&ContactPanel::onCertTimeout,
-                                 this,
-                                 _1,
-                                 onVerifyFailed,
-                                 data,
-                                 nextStep));
- else
-   onVerifyFailed(data);
-}
-
-void
 ContactPanel::onInvitationRegisterFailed(const shared_ptr<const Name>& prefix)
 {
   showError(QString::fromStdString("Cannot register invitation listening prefix"));
diff --git a/src/contactpanel.h b/src/contactpanel.h
index 4d871a1..8bc08e5 100644
--- a/src/contactpanel.h
+++ b/src/contactpanel.h
@@ -109,21 +109,17 @@
                const ndn::OnVerified& onVerified,
                const ndn::OnVerifyFailed& onVerifyFailed,
                const TimeoutNotify& timeoutNotify,
-               int retry = 1,
-               int stepCount = 0);
+               int retry = 1);
 
   void
   onTargetData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
-               int stepCount,
                const ndn::OnVerified& onVerified,
-               const ndn::OnVerifyFailed& onVerifyFailed,
-               const TimeoutNotify& timeoutNotify);
+               const ndn::OnVerifyFailed& onVerifyFailed);
 
   void
   onTargetTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, 
                   int retry,
-                  int stepCount,
                   const ndn::OnVerified& onVerified,
                   const ndn::OnVerifyFailed& onVerifyFailed,
                   const TimeoutNotify& timeoutNotify);
@@ -286,6 +282,7 @@
   ndn::ptr_lib::shared_ptr<std::vector<bool> > m_collectStatus;
 
   ndn::ptr_lib::shared_ptr<SecPolicyChronoChatPanel> m_policy;
+  ndn::ptr_lib::shared_ptr<ndn::Verifier> m_verifier;
   ndn::ptr_lib::shared_ptr<ndn::KeyChain> m_keyChain;
   ndn::ptr_lib::shared_ptr<ndn::Face> m_face;
 
