diff --git a/tests/unit-tests/challenge-email.t.cpp b/tests/unit-tests/challenge-email.t.cpp
index f723f6a..3b9850c 100644
--- a/tests/unit-tests/challenge-email.t.cpp
+++ b/tests/unit-tests/challenge-email.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2017-2018, Regents of the University of California.
+ * Copyright (c) 2017-2019, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -25,7 +25,7 @@
 namespace ndncert {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(TestChallengeEmail, IdentityManagementV2Fixture)
+BOOST_FIXTURE_TEST_SUITE(TestChallengeEmail, IdentityManagementFixture)
 
 BOOST_AUTO_TEST_CASE(TestChallengeType)
 {
@@ -33,20 +33,6 @@
   BOOST_CHECK_EQUAL(challenge.CHALLENGE_TYPE, "Email");
 }
 
-BOOST_AUTO_TEST_CASE(ParseStoredSecret)
-{
-  time::system_clock::TimePoint tp = time::fromIsoString("20170207T120000");
-  JsonSection json;
-  json.put(ChallengeEmail::JSON_CODE_TP, time::toIsoString(tp));
-  json.put(ChallengeEmail::JSON_CODE, "1234");
-  json.put(ChallengeEmail::JSON_ATTEMPT_TIMES, std::to_string(3));
-
-  auto result = ChallengeEmail::parseStoredSecrets(json);
-  BOOST_CHECK_EQUAL(std::get<0>(result), tp);
-  BOOST_CHECK_EQUAL(std::get<1>(result), "1234");
-  BOOST_CHECK_EQUAL(std::get<2>(result), 3);
-}
-
 BOOST_AUTO_TEST_CASE(EmailAddressChecker)
 {
   BOOST_CHECK_EQUAL(ChallengeEmail::isValidEmailAddress("zhiyi@cs.ucla.edu"), true);
@@ -54,28 +40,26 @@
   BOOST_CHECK_EQUAL(ChallengeEmail::isValidEmailAddress("zhiyi.ucla.edu"), false);
 }
 
-BOOST_AUTO_TEST_CASE(OnSelectInterestComingWithEmail)
+BOOST_AUTO_TEST_CASE(OnChallengeRequestWithEmail)
 {
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  CertificateRequest request(Name("/ndn/site1"), "123", cert);
+  CertificateRequest request(Name("/ndn/site1"), "123", STATUS_BEFORE_CHALLENGE, cert);
 
   JsonSection emailJson;
   emailJson.put(ChallengeEmail::JSON_EMAIL, "zhiyi@cs.ucla.edu");
-  std::stringstream ss;
-  boost::property_tree::write_json(ss, emailJson);
-  Block jsonContent = makeStringBlock(ndn::tlv::GenericNameComponent, ss.str());
-
-  Name interestName("/ndn/site1/CA");
-  interestName.append("_SELECT").append("Fake-Request-ID").append("EMAIL").append(jsonContent);
-  Interest interest(interestName);
 
   ChallengeEmail challenge("./tests/unit-tests/test-send-email.sh");
-  challenge.handleChallengeRequest(interest, request);
+  challenge.handleChallengeRequest(emailJson, request);
 
-  BOOST_CHECK_EQUAL(request.getStatus(), ChallengeEmail::NEED_CODE);
-  BOOST_CHECK_EQUAL(request.getChallengeType(), "Email");
+  BOOST_CHECK_EQUAL(request.m_status, STATUS_CHALLENGE);
+  BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengeEmail::NEED_CODE);
+  BOOST_CHECK(request.m_challengeSecrets.get<std::string>(ChallengeEmail::JSON_CODE) != "");
+  BOOST_CHECK(request.m_remainingTime != 0);
+  BOOST_CHECK(request.m_remainingTries != 0);
+  BOOST_CHECK(request.m_challengeTp != "");
+  BOOST_CHECK_EQUAL(request.m_challengeType, "Email");
 
   std::string line = "";
   std::string delimiter = " ";
@@ -89,68 +73,47 @@
   std::string secret = line.substr(line.find(delimiter) + 1);
 
   BOOST_CHECK_EQUAL(recipientEmail, "zhiyi@cs.ucla.edu");
-  auto stored_secret = request.getChallengeSecrets().get<std::string>(ChallengeEmail::JSON_CODE);
+  auto stored_secret = request.m_challengeSecrets.get<std::string>(ChallengeEmail::JSON_CODE);
   BOOST_CHECK_EQUAL(secret, stored_secret);
-
   std::remove("tmp.txt");
 }
 
-BOOST_AUTO_TEST_CASE(OnSelectInterestComingWithInvalidEmail)
+BOOST_AUTO_TEST_CASE(OnChallengeRequestWithInvalidEmail)
 {
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  CertificateRequest request(Name("/ndn/site1"), "123", cert);
+  CertificateRequest request(Name("/ndn/site1"), "123", STATUS_BEFORE_CHALLENGE, cert);
 
   JsonSection emailJson;
   emailJson.put(ChallengeEmail::JSON_EMAIL, "zhiyi@cs");
-  std::stringstream ss;
-  boost::property_tree::write_json(ss, emailJson);
-  Block jsonContent = makeStringBlock(ndn::tlv::GenericNameComponent, ss.str());
-
-  Name interestName("/ndn/site1/CA");
-  interestName.append("_SELECT").append("Fake-Request-ID").append("EMAIL").append(jsonContent);
-  Interest interest(interestName);
 
   ChallengeEmail challenge;
-  challenge.handleChallengeRequest(interest, request);
+  challenge.handleChallengeRequest(emailJson, request);
 
-  BOOST_CHECK_EQUAL(request.getStatus(), ChallengeEmail::FAILURE_INVALID_EMAIL);
-  BOOST_CHECK_EQUAL(request.getChallengeType(), "Email");
+  BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengeEmail::FAILURE_INVALID_EMAIL);
+  BOOST_CHECK_EQUAL(request.m_status, STATUS_FAILURE);
 }
 
-BOOST_AUTO_TEST_CASE(OnValidateInterestComingWithCode)
+BOOST_AUTO_TEST_CASE(OnChallengeRequestWithCode)
 {
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  CertificateRequest request(Name("/ndn/site1"), "123", cert);
-  request.setChallengeType("EMAIL");
-  request.setStatus(ChallengeEmail::NEED_CODE);
-
-  time::system_clock::TimePoint tp = time::system_clock::now();
   JsonSection json;
-  json.put(ChallengeEmail::JSON_CODE_TP, time::toIsoString(tp));
   json.put(ChallengeEmail::JSON_CODE, "4567");
-  json.put(ChallengeEmail::JSON_ATTEMPT_TIMES, std::to_string(3));
+  CertificateRequest request(Name("/ndn/site1"), "123", STATUS_CHALLENGE, ChallengeEmail::NEED_CODE,
+                             "Email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert);
 
-  request.setChallengeSecrets(json);
-
-  JsonSection infoJson;
-  infoJson.put(ChallengeEmail::JSON_CODE, "4567");
-  std::stringstream ss;
-  boost::property_tree::write_json(ss, infoJson);
-  Block jsonContent = makeStringBlock(ndn::tlv::GenericNameComponent, ss.str());
-
-  Name interestName("/ndn/site1/CA");
-  interestName.append("_VALIDATE").append("Fake-Request-ID").append("EMAIL").append(jsonContent);
-  Interest interest(interestName);
+  JsonSection requestJson;
+  requestJson.put(ChallengeEmail::JSON_CODE, "4567");
 
   ChallengeEmail challenge;
-  challenge.handleChallengeRequest(interest, request);
+  challenge.handleChallengeRequest(requestJson, request);
 
-  BOOST_CHECK_EQUAL(request.getStatus(), ChallengeModule::SUCCESS);
-  BOOST_CHECK_EQUAL(request.getChallengeSecrets().empty(), true);
+  BOOST_CHECK_EQUAL(request.m_challengeStatus, CHALLENGE_STATUS_SUCCESS);
+  BOOST_CHECK_EQUAL(request.m_status, STATUS_PENDING);
+  BOOST_CHECK_EQUAL(request.m_challengeSecrets.empty(), true);
 }
 
 BOOST_AUTO_TEST_CASE(OnValidateInterestComingWithWrongCode)
@@ -158,61 +121,20 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  CertificateRequest request(Name("/ndn/site1"), "123", cert);
-  request.setChallengeType("EMAIL");
-  request.setStatus(ChallengeEmail::NEED_CODE);
-
-  time::system_clock::TimePoint tp = time::system_clock::now();
   JsonSection json;
-  json.put(ChallengeEmail::JSON_CODE_TP, time::toIsoString(tp));
   json.put(ChallengeEmail::JSON_CODE, "4567");
-  json.put(ChallengeEmail::JSON_ATTEMPT_TIMES, std::to_string(3));
+  CertificateRequest request(Name("/ndn/site1"), "123", STATUS_CHALLENGE, ChallengeEmail::NEED_CODE,
+                             "Email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert);
 
-  request.setChallengeSecrets(json);
-
-  JsonSection infoJson;
-  infoJson.put(ChallengeEmail::JSON_CODE, "1234");
-  std::stringstream ss;
-  boost::property_tree::write_json(ss, infoJson);
-  Block jsonContent = makeStringBlock(ndn::tlv::GenericNameComponent, ss.str());
-
-  Name interestName("/ndn/site1/CA");
-  interestName.append("_VALIDATE").append("Fake-Request-ID").append("EMAIL").append(jsonContent);
-  Interest interest(interestName);
+  JsonSection requestJson;
+  requestJson.put(ChallengeEmail::JSON_CODE, "7890");
 
   ChallengeEmail challenge;
-  challenge.handleChallengeRequest(interest, request);
+  challenge.handleChallengeRequest(requestJson, request);
 
-  BOOST_CHECK_EQUAL(request.getStatus(), ChallengeEmail::WRONG_CODE);
-  BOOST_CHECK_EQUAL(request.getChallengeSecrets().empty(), false);
-}
-
-BOOST_AUTO_TEST_CASE(ClientSendSelect)
-{
-  ChallengeEmail challenge;
-  auto requirementList = challenge.getSelectRequirements();
-  BOOST_CHECK_EQUAL(requirementList.size(), 1);
-
-  requirementList.clear();
-  requirementList.push_back("zhiyi@cs.ucla.edu");
-
-  auto json = challenge.genSelectParamsJson(ChallengeModule::WAIT_SELECTION, requirementList);
-  BOOST_CHECK_EQUAL(json.empty(), false);
-  BOOST_CHECK_EQUAL(json.get<std::string>(ChallengeEmail::JSON_EMAIL), "zhiyi@cs.ucla.edu");
-}
-
-BOOST_AUTO_TEST_CASE(ClientSendValidate)
-{
-  ChallengeEmail challenge;
-  auto requirementList = challenge.getValidateRequirements(ChallengeEmail::NEED_CODE);
-  BOOST_CHECK_EQUAL(requirementList.size(), 1);
-
-  requirementList.clear();
-  requirementList.push_back("123");
-
-  auto json = challenge.genValidateParamsJson(ChallengeEmail::NEED_CODE, requirementList);
-  BOOST_CHECK_EQUAL(json.empty(), false);
-  BOOST_CHECK_EQUAL(json.get<std::string>(ChallengeEmail::JSON_CODE), "123");
+  BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengeEmail::WRONG_CODE);
+  BOOST_CHECK_EQUAL(request.m_status, STATUS_CHALLENGE);
+  BOOST_CHECK_EQUAL(request.m_challengeSecrets.empty(), false);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
