diff --git a/src/detail/ca-memory.cpp b/src/detail/ca-memory.cpp
index f2a3b12..48a0903 100644
--- a/src/detail/ca-memory.cpp
+++ b/src/detail/ca-memory.cpp
@@ -48,21 +48,21 @@
 void
 CaMemory::addRequest(const RequestState& request)
 {
-  auto search = m_requests.find(request.m_requestId);
+  auto search = m_requests.find(request.requestId);
   if (search == m_requests.end()) {
-    m_requests.insert(std::make_pair(request.m_requestId, request));
+    m_requests.insert(std::make_pair(request.requestId, request));
   }
   else {
-    NDN_THROW(std::runtime_error("Request " + toHex(request.m_requestId.data(), request.m_requestId.size()) + " already exists"));
+    NDN_THROW(std::runtime_error("Request " + toHex(request.requestId.data(), request.requestId.size()) + " already exists"));
   }
 }
 
 void
 CaMemory::updateRequest(const RequestState& request)
 {
-  auto search = m_requests.find(request.m_requestId);
+  auto search = m_requests.find(request.requestId);
   if (search == m_requests.end()) {
-    m_requests.insert(std::make_pair(request.m_requestId, request));
+    m_requests.insert(std::make_pair(request.requestId, request));
   }
   else {
     search->second = request;
@@ -73,7 +73,7 @@
 CaMemory::deleteRequest(const RequestId& requestId)
 {
   auto search = m_requests.find(requestId);
-  auto keyName = search->second.m_cert.getKeyName();
+  auto keyName = search->second.cert.getKeyName();
   if (search != m_requests.end()) {
     m_requests.erase(search);
   }
@@ -94,7 +94,7 @@
 {
   std::list<RequestState> result;
   for (const auto& entry : m_requests) {
-    if (entry.second.m_caPrefix == caName) {
+    if (entry.second.caPrefix == caName) {
       result.push_back(entry.second);
     }
   }
diff --git a/src/detail/ca-request-state.cpp b/src/detail/ca-request-state.cpp
index adb453f..55b5cf9 100644
--- a/src/detail/ca-request-state.cpp
+++ b/src/detail/ca-request-state.cpp
@@ -58,23 +58,23 @@
                                const time::system_clock::TimePoint& challengeTp,
                                size_t remainingTries, time::seconds remainingTime,
                                JsonSection&& challengeSecrets)
-    : m_challengeStatus(challengeStatus)
-    , m_timestamp(challengeTp)
-    , m_remainingTries(remainingTries)
-    , m_remainingTime(remainingTime)
-    , m_secrets(std::move(challengeSecrets))
+    : challengeStatus(challengeStatus)
+    , timestamp(challengeTp)
+    , remainingTries(remainingTries)
+    , remainingTime(remainingTime)
+    , secrets(std::move(challengeSecrets))
 {
 }
 
 RequestState::RequestState(const Name& caName, const RequestId& requestId, RequestType requestType, Status status,
                            const security::Certificate& cert, std::array<uint8_t, 16>&& encryptionKey, uint32_t aesBlockCounter)
-    : m_caPrefix(caName)
-    , m_requestId(requestId)
-    , m_requestType(requestType)
-    , m_status(status)
-    , m_cert(cert)
-    , m_encryptionKey(std::move(encryptionKey))
-    , m_aesBlockCounter(aesBlockCounter)
+    : caPrefix(caName)
+    , requestId(requestId)
+    , requestType(requestType)
+    , status(status)
+    , cert(cert)
+    , encryptionKey(std::move(encryptionKey))
+    , aesBlockCounter(aesBlockCounter)
 {
 }
 
@@ -83,34 +83,34 @@
                            const std::string& challengeStatus, const time::system_clock::TimePoint& challengeTp,
                            size_t remainingTries, time::seconds remainingTime, JsonSection&& challengeSecrets,
                            std::array<uint8_t, 16>&& encryptionKey, uint32_t aesBlockCounter)
-    : m_caPrefix(caName)
-    , m_requestId(requestId)
-    , m_requestType(requestType)
-    , m_status(status)
-    , m_cert(cert)
-    , m_encryptionKey(std::move(encryptionKey))
-    , m_aesBlockCounter(aesBlockCounter)
-    , m_challengeType(challengeType)
-    , m_challengeState(ChallengeState(challengeStatus, challengeTp, remainingTries, remainingTime, std::move(challengeSecrets)))
+    : caPrefix(caName)
+    , requestId(requestId)
+    , requestType(requestType)
+    , status(status)
+    , cert(cert)
+    , encryptionKey(std::move(encryptionKey))
+    , aesBlockCounter(aesBlockCounter)
+    , challengeType(challengeType)
+    , challengeState(ChallengeState(challengeStatus, challengeTp, remainingTries, remainingTime, std::move(challengeSecrets)))
 {
 }
 
 std::ostream&
 operator<<(std::ostream& os, const RequestState& request)
 {
-  os << "Request's CA name: " << request.m_caPrefix << "\n";
-  os << "Request's request ID: " << toHex(request.m_requestId.data(), request.m_requestId.size()) << "\n";
-  os << "Request's status: " << statusToString(request.m_status) << "\n";
-  os << "Request's challenge type: " << request.m_challengeType << "\n";
-  if (request.m_challengeState) {
-    os << "Challenge Status: " << request.m_challengeState->m_challengeStatus << "\n";
-    os << "Challenge remaining tries:" << request.m_challengeState->m_remainingTries << " times\n";
-    os << "Challenge remaining time: " << request.m_challengeState->m_remainingTime.count() << " seconds\n";
-    os << "Challenge last update: " << time::toIsoString(request.m_challengeState->m_timestamp) << "\n";
+  os << "Request's CA name: " << request.caPrefix << "\n";
+  os << "Request's request ID: " << toHex(request.requestId.data(), request.requestId.size()) << "\n";
+  os << "Request's status: " << statusToString(request.status) << "\n";
+  os << "Request's challenge type: " << request.challengeType << "\n";
+  if (request.challengeState) {
+    os << "Challenge Status: " << request.challengeState->challengeStatus << "\n";
+    os << "Challenge remaining tries:" << request.challengeState->remainingTries << " times\n";
+    os << "Challenge remaining time: " << request.challengeState->remainingTime.count() << " seconds\n";
+    os << "Challenge last update: " << time::toIsoString(request.challengeState->timestamp) << "\n";
   }
   os << "Certificate:\n";
   util::IndentedStream os2(os, "  ");
-  os2 << request.m_cert;
+  os2 << request.cert;
   return os;
 }
 
diff --git a/src/detail/ca-request-state.hpp b/src/detail/ca-request-state.hpp
index 160760e..1857509 100644
--- a/src/detail/ca-request-state.hpp
+++ b/src/detail/ca-request-state.hpp
@@ -62,23 +62,23 @@
   /**
    * @brief The status of the challenge.
    */
-  std::string m_challengeStatus;
+  std::string challengeStatus;
   /**
    * @brief The timestamp of the last update of the challenge state.
    */
-  time::system_clock::TimePoint m_timestamp;
+  time::system_clock::TimePoint timestamp;
   /**
    * @brief Remaining tries of the challenge.
    */
-  size_t m_remainingTries;
+  size_t remainingTries;
   /**
    * @brief Remaining time of the challenge.
    */
-  time::seconds m_remainingTime;
+  time::seconds remainingTime;
   /**
    * @brief The secret for the challenge.
    */
-  JsonSection m_secrets;
+  JsonSection secrets;
 };
 
 /**
@@ -107,40 +107,40 @@
   /**
    * @brief The CA that the request is under.
    */
-  Name m_caPrefix;
+  Name caPrefix;
   /**
    * @brief The ID of the request.
    */
-  RequestId m_requestId;
+  RequestId requestId;
   /**
    * @brief The type of the request.
    */
-  RequestType m_requestType = RequestType::NOTINITIALIZED;
+  RequestType requestType = RequestType::NOTINITIALIZED;
   /**
    * @brief The status of the request.
    */
-  Status m_status;
+  Status status;
   /**
    * @brief The self-signed certificate in the request.
    */
-  security::Certificate m_cert;
+  security::Certificate cert;
   /**
    * @brief The encryption key for the requester.
    */
-  std::array<uint8_t, 16> m_encryptionKey;
+  std::array<uint8_t, 16> encryptionKey;
   /**
    * @brief The AES block counter for the requester.
    */
-  uint32_t m_aesBlockCounter = 0;
+  uint32_t aesBlockCounter = 0;
 
   /**
    * @brief The challenge type.
    */
-  std::string m_challengeType;
+  std::string challengeType;
   /**
    * @brief The challenge state.
    */
-  optional<ChallengeState> m_challengeState;
+  optional<ChallengeState> challengeState;
 };
 
 std::ostream&
diff --git a/src/detail/ca-sqlite.cpp b/src/detail/ca-sqlite.cpp
index 6ef80bc..db37397 100644
--- a/src/detail/ca-sqlite.cpp
+++ b/src/detail/ca-sqlite.cpp
@@ -172,24 +172,24 @@
                   cert_request, challenge_type, challenge_status, challenge_secrets,
                   challenge_tp, remaining_tries, remaining_time, encryption_key, aes_block_counter)
                   values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))_SQLTEXT_");
-  statement.bind(1, request.m_requestId.data(), request.m_requestId.size(), SQLITE_TRANSIENT);
-  statement.bind(2, request.m_caPrefix.wireEncode(), SQLITE_TRANSIENT);
-  statement.bind(3, static_cast<int>(request.m_status));
-  statement.bind(4, static_cast<int>(request.m_requestType));
-  statement.bind(5, request.m_cert.wireEncode(), SQLITE_TRANSIENT);
-  statement.bind(12, request.m_encryptionKey.data(), request.m_encryptionKey.size(), SQLITE_TRANSIENT);
-  statement.bind(13, request.m_aesBlockCounter);
-  if (request.m_challengeState) {
-    statement.bind(6, request.m_challengeType, SQLITE_TRANSIENT);
-    statement.bind(7, request.m_challengeState->m_challengeStatus, SQLITE_TRANSIENT);
-    statement.bind(8, convertJson2String(request.m_challengeState->m_secrets),
+  statement.bind(1, request.requestId.data(), request.requestId.size(), SQLITE_TRANSIENT);
+  statement.bind(2, request.caPrefix.wireEncode(), SQLITE_TRANSIENT);
+  statement.bind(3, static_cast<int>(request.status));
+  statement.bind(4, static_cast<int>(request.requestType));
+  statement.bind(5, request.cert.wireEncode(), SQLITE_TRANSIENT);
+  statement.bind(12, request.encryptionKey.data(), request.encryptionKey.size(), SQLITE_TRANSIENT);
+  statement.bind(13, request.aesBlockCounter);
+  if (request.challengeState) {
+    statement.bind(6, request.challengeType, SQLITE_TRANSIENT);
+    statement.bind(7, request.challengeState->challengeStatus, SQLITE_TRANSIENT);
+    statement.bind(8, convertJson2String(request.challengeState->secrets),
                    SQLITE_TRANSIENT);
-    statement.bind(9, time::toIsoString(request.m_challengeState->m_timestamp), SQLITE_TRANSIENT);
-    statement.bind(10, request.m_challengeState->m_remainingTries);
-    statement.bind(11, request.m_challengeState->m_remainingTime.count());
+    statement.bind(9, time::toIsoString(request.challengeState->timestamp), SQLITE_TRANSIENT);
+    statement.bind(10, request.challengeState->remainingTries);
+    statement.bind(11, request.challengeState->remainingTime.count());
   }
   if (statement.step() != SQLITE_DONE) {
-    NDN_THROW(std::runtime_error("Request " + toHex(request.m_requestId.data(), request.m_requestId.size()) + " cannot be added to database"));
+    NDN_THROW(std::runtime_error("Request " + toHex(request.requestId.data(), request.requestId.size()) + " cannot be added to database"));
   }
 }
 
@@ -201,14 +201,14 @@
                              SET status = ?, challenge_type = ?, challenge_status = ?, challenge_secrets = ?,
                              challenge_tp = ?, remaining_tries = ?, remaining_time = ?, aes_block_counter = ?
                              WHERE request_id = ?)_SQLTEXT_");
-  statement.bind(1, static_cast<int>(request.m_status));
-  statement.bind(2, request.m_challengeType, SQLITE_TRANSIENT);
-  if (request.m_challengeState) {
-    statement.bind(3, request.m_challengeState->m_challengeStatus, SQLITE_TRANSIENT);
-    statement.bind(4, convertJson2String(request.m_challengeState->m_secrets), SQLITE_TRANSIENT);
-    statement.bind(5, time::toIsoString(request.m_challengeState->m_timestamp), SQLITE_TRANSIENT);
-    statement.bind(6, request.m_challengeState->m_remainingTries);
-    statement.bind(7, request.m_challengeState->m_remainingTime.count());
+  statement.bind(1, static_cast<int>(request.status));
+  statement.bind(2, request.challengeType, SQLITE_TRANSIENT);
+  if (request.challengeState) {
+    statement.bind(3, request.challengeState->challengeStatus, SQLITE_TRANSIENT);
+    statement.bind(4, convertJson2String(request.challengeState->secrets), SQLITE_TRANSIENT);
+    statement.bind(5, time::toIsoString(request.challengeState->timestamp), SQLITE_TRANSIENT);
+    statement.bind(6, request.challengeState->remainingTries);
+    statement.bind(7, request.challengeState->remainingTime.count());
   }
   else {
     statement.bind(3, "", SQLITE_TRANSIENT);
@@ -217,8 +217,8 @@
     statement.bind(6, 0);
     statement.bind(7, 0);
   }
-  statement.bind(8, request.m_aesBlockCounter);
-  statement.bind(9, request.m_requestId.data(), request.m_requestId.size(), SQLITE_TRANSIENT);
+  statement.bind(8, request.aesBlockCounter);
+  statement.bind(9, request.requestId.data(), request.requestId.size(), SQLITE_TRANSIENT);
 
   if (statement.step() != SQLITE_DONE) {
     addRequest(request);
diff --git a/src/detail/challenge-encoder.cpp b/src/detail/challenge-encoder.cpp
index 41a0f8f..12eb7cf 100644
--- a/src/detail/challenge-encoder.cpp
+++ b/src/detail/challenge-encoder.cpp
@@ -27,21 +27,21 @@
 challengetlv::encodeDataContent(ca::RequestState& request, const Name& issuedCertName)
 {
   Block response(tlv::EncryptedPayload);
-  response.push_back(makeNonNegativeIntegerBlock(tlv::Status, static_cast<uint64_t>(request.m_status)));
-  if (request.m_challengeState) {
-    response.push_back(makeStringBlock(tlv::ChallengeStatus, request.m_challengeState->m_challengeStatus));
+  response.push_back(makeNonNegativeIntegerBlock(tlv::Status, static_cast<uint64_t>(request.status)));
+  if (request.challengeState) {
+    response.push_back(makeStringBlock(tlv::ChallengeStatus, request.challengeState->challengeStatus));
     response.push_back(
-        makeNonNegativeIntegerBlock(tlv::RemainingTries, request.m_challengeState->m_remainingTries));
+        makeNonNegativeIntegerBlock(tlv::RemainingTries, request.challengeState->remainingTries));
     response.push_back(
-        makeNonNegativeIntegerBlock(tlv::RemainingTime, request.m_challengeState->m_remainingTime.count()));
+        makeNonNegativeIntegerBlock(tlv::RemainingTime, request.challengeState->remainingTime.count()));
   }
   if (!issuedCertName.empty()) {
     response.push_back(makeNestedBlock(tlv::IssuedCertName, issuedCertName));
   }
   response.encode();
-  return encodeBlockWithAesGcm128(ndn::tlv::Content, request.m_encryptionKey.data(),
+  return encodeBlockWithAesGcm128(ndn::tlv::Content, request.encryptionKey.data(),
                                   response.value(), response.value_size(),
-                                  request.m_requestId.data(), request.m_requestId.size(), request.m_aesBlockCounter);
+                                  request.requestId.data(), request.requestId.size(), request.aesBlockCounter);
 }
 
 void
diff --git a/src/detail/probe-encoder.cpp b/src/detail/probe-encoder.cpp
index e8f5218..d671aef 100644
--- a/src/detail/probe-encoder.cpp
+++ b/src/detail/probe-encoder.cpp
@@ -24,7 +24,7 @@
 namespace ndncert {
 
 Block
-probetlv::encodeApplicationParameters(std::multimap<std::string, std::string>&& parameters)
+probetlv::encodeApplicationParameters(const std::multimap<std::string, std::string>& parameters)
 {
   Block content(ndn::tlv::ApplicationParameters);
   for (const auto& items : parameters) {
diff --git a/src/detail/probe-encoder.hpp b/src/detail/probe-encoder.hpp
index 2b63cc1..bde8a87 100644
--- a/src/detail/probe-encoder.hpp
+++ b/src/detail/probe-encoder.hpp
@@ -29,7 +29,7 @@
 
 // For Client use
 Block
-encodeApplicationParameters(std::multimap<std::string, std::string>&& parameters);
+encodeApplicationParameters(const std::multimap<std::string, std::string>& parameters);
 
 void
 decodeDataContent(const Block& block, std::vector<std::pair<Name, int>>& availableNames,
