diff --git a/src/clients/response.cpp b/src/clients/response.cpp
index 5f223d3..3da172b 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-2018, Regents of the University of California.
+ * Copyright (c) 2014-2020, 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.
@@ -26,7 +26,7 @@
 Response::Response()
   : m_contentType(NDNS_BLOB)
   , m_freshnessPeriod(DEFAULT_RR_FRESHNESS_PERIOD)
-  , m_appContent(makeBinaryBlock(ndn::tlv::Content, reinterpret_cast<const uint8_t*>(0), 0))
+  , m_appContent(makeEmptyBlock(ndn::tlv::Content))
 {
 }
 
@@ -35,12 +35,12 @@
   , m_queryType(queryType)
   , m_contentType(NDNS_BLOB)
   , m_freshnessPeriod(DEFAULT_RR_FRESHNESS_PERIOD)
-  , m_appContent(makeBinaryBlock(ndn::tlv::Content, reinterpret_cast<const uint8_t*>(0), 0))
+  , m_appContent(makeEmptyBlock(ndn::tlv::Content))
 {
 }
 
 template<encoding::Tag T>
-inline size_t
+size_t
 Response::wireEncode(EncodingImpl<T>& block) const
 {
   if (m_contentType == NDNS_BLOB || m_contentType == NDNS_KEY) {
@@ -52,8 +52,7 @@
   //              Block*
 
   size_t totalLength = 0;
-  for (std::vector<Block>::const_reverse_iterator iter = m_rrs.rbegin();
-       iter != m_rrs.rend(); ++iter) {
+  for (auto iter = m_rrs.rbegin(); iter != m_rrs.rend(); ++iter) {
     totalLength += block.prependBlock(*iter);
   }
 
@@ -176,7 +175,7 @@
 bool
 Response::removeRr(const Block& rr)
 {
-  for (std::vector<Block>::iterator iter = m_rrs.begin(); iter != m_rrs.end(); ++iter) {
+  for (auto iter = m_rrs.begin(); iter != m_rrs.end(); ++iter) {
     if (*iter == rr) {
       m_rrs.erase(iter);
       return true;
@@ -207,14 +206,13 @@
               getRrType() == other.getRrType() && getVersion() == other.getVersion() &&
               getContentType() == other.getContentType());
 
-  if (tmp == false)
-    return tmp;
+  if (!tmp)
+    return false;
 
-  if (m_contentType == NDNS_BLOB || m_contentType == NDNS_KEY) {
-    return tmp && (getAppContent() == other.getAppContent());
-  }
+  if (m_contentType == NDNS_BLOB || m_contentType == NDNS_KEY)
+    return getAppContent() == other.getAppContent();
   else
-    return tmp && getRrs() == other.getRrs();
+    return getRrs() == other.getRrs();
 }
 
 std::ostream&
@@ -229,15 +227,16 @@
      << " NdnsContentType=" << response.getContentType();
   if (response.getContentType() == NDNS_BLOB
       || response.getContentType() == NDNS_KEY) {
-    if (response.getAppContent().empty())
-      os << " appContent=NULL";
-    else
+    if (response.getAppContent().isValid())
       os << " appContentSize=" << response.getAppContent().size();
+    else
+      os << " appContent=NULL";
   }
   else {
     os << " rrs.size=" << response.getRrs().size();
   }
   return os;
 }
+
 } // namespace ndns
 } // namespace ndn
diff --git a/src/mgmt/management-tool.cpp b/src/mgmt/management-tool.cpp
index 3832561..3119840 100644
--- a/src/mgmt/management-tool.cpp
+++ b/src/mgmt/management-tool.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-2020, 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.
@@ -447,7 +447,7 @@
       os << "; rrset=" << rrset.getLabel().toUri()
          << " type=" << rrset.getType().toUri()
          << " version=" << rrset.getVersion().toUri()
-         << " signed-by=" << data.getSignature().getKeyLocator().getName().toUri()
+         << " signed-by=" << data.getKeyLocator()->getName().toUri()
          << std::endl;
     }
 
@@ -494,7 +494,7 @@
       os.width();
       os << "; content-type=" << re.getContentType()
          << " version=" << rrset.getVersion().toUri()
-         << " signed-by=" << data.getSignature().getKeyLocator().getName().toUri();
+         << " signed-by=" << data.getKeyLocator()->getName().toUri();
       os << std::endl;
 
       if (printRaw && (re.getContentType() == NDNS_BLOB
diff --git a/src/util/util.cpp b/src/util/util.cpp
index 7d350a5..8466733 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-2019, Regents of the University of California.
+ * Copyright (c) 2014-2020, 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.
@@ -64,8 +64,11 @@
     bufferSource(block.wire(), block.size()) >> base64Encode() >> streamSink(os);
   }
   else {
-    os << "Name: " << data.getName().toUri() << std::endl;
-    os << "KeyLocator: " << data.getSignature().getKeyLocator().getName().toUri() << std::endl;
+    os << "Name: " << data.getName() << std::endl;
+    auto kl = data.getKeyLocator();
+    if (kl) {
+      os << "KeyLocator: " << kl->getName() << std::endl;
+    }
     bufferSource(block.wire(), block.size()) >> base64Encode() >> streamSink(os);
     os << std::endl;
   }
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index ab60698..64a9a97 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2020, 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.
@@ -93,7 +93,7 @@
 
   v2::AdditionalDescription description;
   description.set("type", "sub-certificate");
-  info.appendTypeSpecificTlv(description.wireEncode());
+  info.addCustomTlv(description.wireEncode());
 
   m_keyChain.sign(request, signingByIdentity(issuer).setSignatureInfo(info));
   m_keyChain.setDefaultCertificate(subIdentity.getDefaultKey(), request);
diff --git a/tests/unit/daemon/name-server.cpp b/tests/unit/daemon/name-server.cpp
index dae6685..76daa2f 100644
--- a/tests/unit/daemon/name-server.cpp
+++ b/tests/unit/daemon/name-server.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-2020, 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.
@@ -285,7 +285,7 @@
   m_keyChain.setDefaultCertificate(dsk, dskCert);
 
   NDNS_LOG_TRACE("KeyChain: add cert: " << dskCert.getName() << ". KeyLocator: "
-                 << dskCert.getSignature().getKeyLocator().getName());
+                 << dskCert.getKeyLocator()->getName());
 
   Rrset rrset(&m_test);
   Name label = dskCert.getName().getPrefix(-2).getSubName(m_test.getName().size() + 1);
@@ -324,7 +324,7 @@
   bool hasDataBack = false;
 
   // no data back, since the Update cannot pass verification
-  face.onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data&) {
     hasDataBack = true;
     BOOST_FAIL("UNEXPECTED");
   });
diff --git a/tools/ndns-update.cpp b/tools/ndns-update.cpp
index 2a454f8..91c3ea1 100644
--- a/tools/ndns-update.cpp
+++ b/tools/ndns-update.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-2020, 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.
@@ -68,9 +68,7 @@
                   << "start to update RR at Zone = " << this->m_zone
                   << " new RR is: " << m_update->getName()
                   <<" =================== ");
-
-    NDNS_LOG_INFO("new RR is signed by: "
-                  << m_update->getSignature().getKeyLocator().getName());
+    NDNS_LOG_INFO("new RR is signed by: " << m_update->getKeyLocator()->getName());
 
     Interest interest = this->makeUpdateInterest();
     NDNS_LOG_TRACE("[* <- *] send Update: " << m_update->getName().toUri());
@@ -89,7 +87,7 @@
 
 private:
   void
-  onData(const Interest& interest, const Data& data)
+  onData(const Interest&, const Data& data)
   {
     NDNS_LOG_INFO("get response of Update");
     int ret = -1;
@@ -106,9 +104,8 @@
 
     NDNS_LOG_INFO("to verify the response");
     m_validator->validate(data,
-                         bind(&NdnsUpdate::onDataValidated, this, _1),
-                         bind(&NdnsUpdate::onDataValidationFailed, this, _1, _2)
-                         );
+                          bind(&NdnsUpdate::onDataValidated, this, _1),
+                          bind(&NdnsUpdate::onDataValidationFailed, this, _1, _2));
   }
 
   std::tuple<int, std::string>
@@ -120,7 +117,7 @@
     blk.parse();
     Block block = blk.blockFromValue();
     block.parse();
-    Block::element_const_iterator val = block.elements_begin();
+    auto val = block.elements_begin();
     for (; val != block.elements_end(); ++val) {
       if (val->type() == ndns::tlv::UpdateReturnCode) { // the first must be return code
         ret = readNonNegativeInteger(*val);
@@ -149,22 +146,22 @@
 
 private:
   void
-  onTimeout(const ndn::Interest& interest)
+  onTimeout(const ndn::Interest&)
   {
-    NDNS_LOG_TRACE("Update timeouts");
+    NDNS_LOG_TRACE("Update timeout");
     m_hasError = true;
     this->stop();
   }
 
   void
-  onDataValidated(const Data& data)
+  onDataValidated(const Data&)
   {
     NDNS_LOG_INFO("data pass verification");
     this->stop();
   }
 
   void
-  onDataValidationFailed(const Data& data, const security::v2::ValidationError& str)
+  onDataValidationFailed(const Data&, const security::v2::ValidationError&)
   {
     NDNS_LOG_INFO("data does not pass verification");
     m_hasError = true;
@@ -172,7 +169,6 @@
   }
 
 public:
-
   void
   setInterestLifetime(const time::milliseconds& interestLifetime)
   {
