diff --git a/src/clients/response.cpp b/src/clients/response.cpp
index b183b1d..48b8a7d 100644
--- a/src/clients/response.cpp
+++ b/src/clients/response.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -20,6 +20,8 @@
 #include "response.hpp"
 #include "logger.hpp"
 
+#include <ndn-cxx/encoding/block-helpers.hpp>
+
 namespace ndn {
 namespace ndns {
 
@@ -39,13 +41,13 @@
 {
 }
 
-template<encoding::Tag T>
+template<encoding::Tag TAG>
 size_t
-Response::wireEncode(EncodingImpl<T>& block) const
+Response::wireEncode(EncodingImpl<TAG>& encoder) const
 {
   if (m_contentType == NDNS_BLOB || m_contentType == NDNS_KEY) {
     // Raw application content
-    return block.prependBlock(m_appContent);
+    return prependBlock(encoder, m_appContent);
   }
 
   // Content :: = CONTENT-TYPE TLV-LENGTH
@@ -53,16 +55,15 @@
 
   size_t totalLength = 0;
   for (auto iter = m_rrs.rbegin(); iter != m_rrs.rend(); ++iter) {
-    totalLength += block.prependBlock(*iter);
+    totalLength += prependBlock(encoder, *iter);
   }
 
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(::ndn::tlv::Content);
-
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(ndn::tlv::Content);
   return totalLength;
 }
 
-const Block
+Block
 Response::wireEncode() const
 {
   if (m_contentType == NDNS_BLOB || m_contentType == NDNS_KEY) {
@@ -86,7 +87,7 @@
 
   wire.parse();
 
-  Block::element_const_iterator iter = wire.elements().begin();
+  auto iter = wire.elements().begin();
   for (; iter != wire.elements().end(); ++iter) {
     m_rrs.push_back(*iter);
   }
@@ -99,7 +100,7 @@
   if (wire.elements().size() != 2) {
     NDN_THROW(Error("Unexpected number of elements while decoding DOE record"));
   }
-  return std::make_pair(Name(wire.elements().front()), Name(wire.elements().back()));
+  return {Name(wire.elements().front()), Name(wire.elements().back())};
 }
 
 bool
diff --git a/src/clients/response.hpp b/src/clients/response.hpp
index a97fb76..4e8f335 100644
--- a/src/clients/response.hpp
+++ b/src/clients/response.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -24,16 +24,9 @@
 #include "ndns-enum.hpp"
 #include "ndns-label.hpp"
 
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/name.hpp>
 #include <ndn-cxx/data.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-#include <ndn-cxx/encoding/block.hpp>
 #include <ndn-cxx/meta-info.hpp>
 
-#include <vector>
-
 namespace ndn {
 namespace ndns {
 
@@ -102,7 +95,7 @@
   /**
    * @brief encode the app-level data
    */
-  const Block
+  Block
   wireEncode() const;
 
   /**
@@ -116,15 +109,12 @@
    */
   template<encoding::Tag T>
   size_t
-  wireEncode(EncodingImpl<T>& block) const;
+  wireEncode(EncodingImpl<T>& encoder) const;
 
   static std::pair<Name, Name>
   wireDecodeDoe(const Block& wire);
 
-public:
-  ///////////////////////////////////////////////
-  // getter and setter
-
+public: // getter and setter
   const Name&
   getZone() const
   {
diff --git a/src/daemon/db-mgr.cpp b/src/daemon/db-mgr.cpp
index 27c7332..e1ab0fc 100644
--- a/src/daemon/db-mgr.cpp
+++ b/src/daemon/db-mgr.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -150,7 +150,7 @@
   while (nBytesLeft > 0) {
     bool hasDecodingSucceeded;
     name::Component component;
-    std::tie(hasDecodingSucceeded, component) = Block::fromBuffer(buffer, nBytesLeft);
+    std::tie(hasDecodingSucceeded, component) = Block::fromBuffer({buffer, nBytesLeft});
     if (!hasDecodingSucceeded) {
       NDN_THROW(Error("Error while decoding name from the database"));
     }
@@ -213,8 +213,8 @@
   }
 
   sqlite3_bind_int(stmt,  1, zone.getId());
-  sqlite3_bind_text(stmt, 2, key.data(),  key.length(), SQLITE_STATIC);
-  sqlite3_bind_blob(stmt, 3, value.wire(), value.size(), SQLITE_STATIC);
+  sqlite3_bind_text(stmt, 2, key.data(),   key.length(), SQLITE_STATIC);
+  sqlite3_bind_blob(stmt, 3, value.data(), value.size(), SQLITE_STATIC);
 
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
@@ -250,8 +250,8 @@
 
   while (sqlite3_step(stmt) == SQLITE_ROW) {
     const char* key = reinterpret_cast<const char*>(sqlite3_column_text(stmt, 0));
-    rtn[string(key)] = Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 1)),
-                             sqlite3_column_bytes(stmt, 1));
+    rtn[string(key)] = Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 1)),
+                                       sqlite3_column_bytes(stmt, 1)));
   }
 
   sqlite3_finalize(stmt);
@@ -364,10 +364,10 @@
   sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
 
   saveName(rrset.getLabel(), stmt, 2);
-  sqlite3_bind_blob(stmt,  3, rrset.getType().wire(),    rrset.getType().size(),    SQLITE_STATIC);
-  sqlite3_bind_blob(stmt,  4, rrset.getVersion().wire(), rrset.getVersion().size(), SQLITE_STATIC);
+  sqlite3_bind_blob(stmt,  3, rrset.getType().data(),    rrset.getType().size(),    SQLITE_STATIC);
+  sqlite3_bind_blob(stmt,  4, rrset.getVersion().data(), rrset.getVersion().size(), SQLITE_STATIC);
   sqlite3_bind_int64(stmt, 5, rrset.getTtl().count());
-  sqlite3_bind_blob(stmt,  6, rrset.getData().wire(),    rrset.getData().size(),    SQLITE_STATIC);
+  sqlite3_bind_blob(stmt,  6, rrset.getData().data(),    rrset.getData().size(),    SQLITE_STATIC);
 
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
@@ -405,15 +405,15 @@
   sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
 
   saveName(rrset.getLabel(), stmt, 2);
-  sqlite3_bind_blob(stmt, 3, rrset.getType().wire(), rrset.getType().size(), SQLITE_STATIC);
+  sqlite3_bind_blob(stmt, 3, rrset.getType().data(), rrset.getType().size(), SQLITE_STATIC);
 
   if (sqlite3_step(stmt) == SQLITE_ROW) {
     rrset.setId(sqlite3_column_int64(stmt, 0));
     rrset.setTtl(time::seconds(sqlite3_column_int64(stmt, 1)));
-    rrset.setVersion(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 2)),
-                           sqlite3_column_bytes(stmt, 2)));
-    rrset.setData(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 3)),
-                        sqlite3_column_bytes(stmt, 3)));
+    rrset.setVersion(Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 2)),
+                                     sqlite3_column_bytes(stmt, 2))));
+    rrset.setData(Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 3)),
+                                  sqlite3_column_bytes(stmt, 3))));
   }
   else {
     rrset.setId(0);
@@ -449,15 +449,15 @@
   sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
 
   saveName(rrset.getLabel(), stmt, 2);
-  sqlite3_bind_blob(stmt, 3, rrset.getType().wire(), rrset.getType().size(), SQLITE_STATIC);
+  sqlite3_bind_blob(stmt, 3, rrset.getType().data(), rrset.getType().size(), SQLITE_STATIC);
 
   if (sqlite3_step(stmt) == SQLITE_ROW) {
     rrset.setId(sqlite3_column_int64(stmt, 0));
     rrset.setTtl(time::seconds(sqlite3_column_int64(stmt, 1)));
-    rrset.setVersion(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 2)),
-                           sqlite3_column_bytes(stmt, 2)));
-    rrset.setData(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 3)),
-                        sqlite3_column_bytes(stmt, 3)));
+    rrset.setVersion(Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 2)),
+                                     sqlite3_column_bytes(stmt, 2))));
+    rrset.setData(Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 3)),
+                                  sqlite3_column_bytes(stmt, 3))));
   }
   else {
     rrset.setId(0);
@@ -493,13 +493,13 @@
 
     rrset.setId(sqlite3_column_int64(stmt, 0));
     rrset.setTtl(time::seconds(sqlite3_column_int64(stmt, 1)));
-    rrset.setVersion(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 2)),
-                           sqlite3_column_bytes(stmt, 2)));
-    rrset.setData(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 3)),
-                        sqlite3_column_bytes(stmt, 3)));
+    rrset.setVersion(Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 2)),
+                                     sqlite3_column_bytes(stmt, 2))));
+    rrset.setData(Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 3)),
+                                  sqlite3_column_bytes(stmt, 3))));
     rrset.setLabel(restoreName(stmt, 4));
-    rrset.setType(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 5)),
-                  sqlite3_column_bytes(stmt, 5)));
+    rrset.setType(Block(make_span(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 5)),
+                                  sqlite3_column_bytes(stmt, 5))));
   }
   sqlite3_finalize(stmt);
 
@@ -523,7 +523,7 @@
   }
 
   sqlite3_bind_int64(stmt, 1, zone.getId());
-  sqlite3_bind_blob(stmt,  2, type.wire(), type.size(), SQLITE_STATIC);
+  sqlite3_bind_blob(stmt,  2, type.data(), type.size(), SQLITE_STATIC);
 
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
@@ -578,8 +578,8 @@
   }
 
   sqlite3_bind_int64(stmt, 1, rrset.getTtl().count());
-  sqlite3_bind_blob(stmt,  2, rrset.getVersion().wire(), rrset.getVersion().size(), SQLITE_STATIC);
-  sqlite3_bind_blob(stmt,  3, rrset.getData().wire(),    rrset.getData().size(),    SQLITE_STATIC);
+  sqlite3_bind_blob(stmt,  2, rrset.getVersion().data(), rrset.getVersion().size(), SQLITE_STATIC);
+  sqlite3_bind_blob(stmt,  3, rrset.getData().data(),    rrset.getData().size(),    SQLITE_STATIC);
   sqlite3_bind_int64(stmt, 4, rrset.getId());
 
   sqlite3_step(stmt);
diff --git a/src/daemon/rrset-factory.cpp b/src/daemon/rrset-factory.cpp
index cded8e0..eed7ad0 100644
--- a/src/daemon/rrset-factory.cpp
+++ b/src/daemon/rrset-factory.cpp
@@ -60,7 +60,7 @@
 RrsetFactory::onlyCheckZone()
 {
   if (m_checked) {
-    return ;
+    return;
   }
   m_checked = true;
 
@@ -71,7 +71,6 @@
   }
 }
 
-
 std::pair<Rrset, Name>
 RrsetFactory::generateBaseRrset(const Name& label,
                                 const name::Component& type,
@@ -158,10 +157,9 @@
   std::tie(rrset, name) = generateBaseRrset(label, label::TXT_RR_TYPE, version, ttl);
 
   std::vector<Block> rrs;
+  rrs.reserve(strings.size());
   for (const auto& item : strings) {
-    rrs.push_back(makeBinaryBlock(ndns::tlv::RrData,
-                                  item.c_str(),
-                                  item.size()));
+    rrs.push_back(makeBinaryBlock(ndns::tlv::RrData, item.data(), item.size()));
   }
 
   Data data(name);
@@ -274,24 +272,23 @@
 }
 
 template<encoding::Tag TAG>
-inline size_t
-RrsetFactory::wireEncode(EncodingImpl<TAG>& block, const std::vector<Block>& rrs) const
+size_t
+RrsetFactory::wireEncode(EncodingImpl<TAG>& encoder, const std::vector<Block>& rrs) const
 {
   // Content :: = CONTENT-TYPE TLV-LENGTH
   //              Block*
 
   size_t totalLength = 0;
   for (auto iter = rrs.rbegin(); iter != rrs.rend(); ++iter) {
-    totalLength += block.prependBlock(*iter);
+    totalLength += prependBlock(encoder, *iter);
   }
 
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(::ndn::tlv::Content);
-
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(ndn::tlv::Content);
   return totalLength;
 }
 
-const Block
+Block
 RrsetFactory::wireEncode(const std::vector<Block>& rrs) const
 {
   EncodingEstimator estimator;
@@ -315,6 +312,5 @@
   return txts;
 }
 
-
 } // namespace ndns
 } // namespace ndn
diff --git a/src/daemon/rrset-factory.hpp b/src/daemon/rrset-factory.hpp
index bffb093..0daa27f 100644
--- a/src/daemon/rrset-factory.hpp
+++ b/src/daemon/rrset-factory.hpp
@@ -106,18 +106,17 @@
   matchCertificate(const Name& certName, const Name& identity);
 
   template<encoding::Tag TAG>
-  inline size_t
-  wireEncode(EncodingImpl<TAG>& block, const std::vector<Block>& rrs) const;
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder, const std::vector<Block>& rrs) const;
 
-  const Block
+  Block
   wireEncode(const std::vector<Block>& rrs) const;
 
   void
   sign(Data& data);
 
   void
-  setContentType(Data& data, NdnsContentType contentType,
-                 const time::seconds& ttl);
+  setContentType(Data& data, NdnsContentType contentType, const time::seconds& ttl);
 
 private:
   KeyChain& m_keyChain;
diff --git a/src/mgmt/management-tool.cpp b/src/mgmt/management-tool.cpp
index 02299c9..9ac88cf 100644
--- a/src/mgmt/management-tool.cpp
+++ b/src/mgmt/management-tool.cpp
@@ -217,7 +217,6 @@
   shared_ptr<Regex> regex = make_shared<Regex>("(<>*)<NDNS>(<>+)<CERT><>");
   if (!regex->match(certName)) {
     NDN_THROW(Error("Certificate name is illegal"));
-    return;
   }
 
   Name zoneName = regex->expand("\\1");
@@ -482,7 +481,7 @@
           os << std::endl;
         }
         else {
-          bufferSource(rrs[i].wire(), rrs[i].size()) >> base64Encode() >> streamSink(os);
+          bufferSource(rrs[i]) >> base64Encode() >> streamSink(os);
         }
       }
     }
@@ -504,7 +503,7 @@
           // cert.printCertificate(istream);
         }
         else {
-          bufferSource(re.getAppContent().wire(), re.getAppContent().size()) >> base64Encode() >> streamSink(os);
+          bufferSource(re.getAppContent()) >> base64Encode() >> streamSink(os);
         }
       }
       os << std::endl;
@@ -572,7 +571,7 @@
     return;
   }
 
-  bufferSource(rrset.getData().wire(), rrset.getData().size()) >> base64Encode() >> streamSink(os);
+  bufferSource(rrset.getData()) >> base64Encode() >> streamSink(os);
 }
 
 void
@@ -624,11 +623,12 @@
 ManagementTool::matchCertificate(const Name& certName, const Name& identity)
 {
   security::Identity id = m_keyChain.getPib().getIdentity(identity);
-  for (const security::Key& key: id.getKeys()) {
+  for (const security::Key& key : id.getKeys()) {
     try {
       key.getCertificate(certName);
       return true;
-    } catch (const std::exception&) {
+    }
+    catch (const std::exception&) {
     }
   }
   return false;
diff --git a/src/ndns-enum.cpp b/src/ndns-enum.cpp
index 37a5b7d..e8351a1 100644
--- a/src/ndns-enum.cpp
+++ b/src/ndns-enum.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -23,7 +23,7 @@
 namespace ndns {
 
 std::ostream&
-operator<<(std::ostream& os, const NdnsContentType ndnsType)
+operator<<(std::ostream& os, NdnsContentType ndnsType)
 {
   switch (ndnsType) {
   case NDNS_BLOB:
diff --git a/src/ndns-enum.hpp b/src/ndns-enum.hpp
index eb4ea35..f7ced20 100644
--- a/src/ndns-enum.hpp
+++ b/src/ndns-enum.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -27,7 +27,7 @@
 namespace ndns {
 
 /**
- * @brief contentType of response
+ * @brief ContentType of response
  */
 enum NdnsContentType {
   NDNS_BLOB = ndn::tlv::ContentType_Blob,
@@ -41,10 +41,10 @@
 };
 
 std::ostream&
-operator<<(std::ostream& os, const NdnsContentType contentType);
+operator<<(std::ostream& os, NdnsContentType contentType);
 
 /**
- * @brief define Return code of Update's Response
+ * @brief Return code of Update response
  */
 enum UpdateReturnCode {
   UPDATE_OK = 0, ///< Update succeeds
diff --git a/src/util/cert-helper.cpp b/src/util/cert-helper.cpp
index ae33e00..3e52f21 100644
--- a/src/util/cert-helper.cpp
+++ b/src/util/cert-helper.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -108,7 +108,7 @@
   certificate.setFreshnessPeriod(time::hours(1));
 
   // set content
-  certificate.setContent(key.getPublicKey().data(), key.getPublicKey().size());
+  certificate.setContent(key.getPublicKey());
 
   // set signature-info
   // to overcome the round-up issue in ndn-cxx setPeriod (notBefore is round up to the the next whole second)
diff --git a/src/util/util.cpp b/src/util/util.cpp
index 8466733..d576311 100644
--- a/src/util/util.cpp
+++ b/src/util/util.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -47,7 +47,7 @@
   else if (str == "link")
     return NDNS_LINK;
   else if (str == "key")
-    return NDNS_LINK;
+    return NDNS_KEY;
   else
     return NDNS_UNKNOWN;
 }
@@ -61,7 +61,7 @@
 
   const Block& block = data.wireEncode();
   if (!isPretty) {
-    bufferSource(block.wire(), block.size()) >> base64Encode() >> streamSink(os);
+    bufferSource(block) >> base64Encode() >> streamSink(os);
   }
   else {
     os << "Name: " << data.getName() << std::endl;
@@ -69,7 +69,7 @@
     if (kl) {
       os << "KeyLocator: " << kl->getName() << std::endl;
     }
-    bufferSource(block.wire(), block.size()) >> base64Encode() >> streamSink(os);
+    bufferSource(block) >> base64Encode() >> streamSink(os);
     os << std::endl;
   }
 }
