diff --git a/tests/key-chain-fixture.cpp b/tests/key-chain-fixture.cpp
index c374fa3..c1abcf8 100644
--- a/tests/key-chain-fixture.cpp
+++ b/tests/key-chain-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-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.
@@ -55,7 +55,7 @@
   cert.setFreshnessPeriod(1_h);
 
   // set content
-  cert.setContent(key.getPublicKey().data(), key.getPublicKey().size());
+  cert.setContent(key.getPublicKey());
 
   // set signature info
   ndn::SignatureInfo info;
diff --git a/tests/unit/daemon/name-server.t.cpp b/tests/unit/daemon/name-server.t.cpp
index 8ca796d..a0ec0f5 100644
--- a/tests/unit/daemon/name-server.t.cpp
+++ b/tests/unit/daemon/name-server.t.cpp
@@ -177,13 +177,12 @@
   str = "ns2.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
 
-  shared_ptr<Data> data = re.toData();
+  auto data = re.toData();
   m_keyChain.sign(*data, security::signingByCertificate(m_cert));
 
   Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
-  const Block& block = data->wireEncode();
   Name name;
-  name.append(block);
+  name.append(ndn::tlv::GenericNameComponent, data->wireEncode());
 
   q.setRrLabel(name);
   q.setRrType(label::NDNS_UPDATE_LABEL);
@@ -228,13 +227,12 @@
   str = "ns2.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
 
-  shared_ptr<Data> data = re.toData();
+  auto data = re.toData();
   m_keyChain.sign(*data, security::signingByCertificate(m_cert));
 
   Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
-  const Block& block = data->wireEncode();
   Name name;
-  name.append(block);
+  name.append(ndn::tlv::GenericNameComponent, data->wireEncode());
 
   q.setRrLabel(name);
   q.setRrType(label::NDNS_UPDATE_LABEL);
@@ -279,7 +277,7 @@
   dskCert.setName(dskCertName);
   dskCert.setContentType(ndn::tlv::ContentType_Key);
   dskCert.setFreshnessPeriod(time::hours(1));
-  dskCert.setContent(dsk.getPublicKey().data(), dsk.getPublicKey().size());
+  dskCert.setContent(dsk.getPublicKey());
   SignatureInfo info;
   info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
                                                   time::system_clock::now() + time::days(365)));
@@ -313,13 +311,12 @@
   str = "ns2.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
 
-  shared_ptr<Data> data = re.toData();
+  auto data = re.toData();
   m_keyChain.sign(*data, security::signingByCertificate(dskCert));
 
   Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
-  const Block& block = data->wireEncode();
   Name name;
-  name.append(block);
+  name.append(ndn::tlv::GenericNameComponent, data->wireEncode());
 
   q.setRrLabel(name);
   q.setRrType(label::NDNS_UPDATE_LABEL);
@@ -353,11 +350,8 @@
 
     validatorFace.onSendInterest.connect([this] (const Interest& interest) {
       NDNS_LOG_TRACE("validatorFace get Interest: " << interest.getName());
-
-      shared_ptr<const Interest> i = interest.shared_from_this();
-      io.post([i, this] {
-          face.receive(*i);
-        });
+      auto i = interest.shared_from_this();
+      io.post([i, this] { face.receive(*i); });
     });
   }
 
@@ -391,13 +385,12 @@
   str = "ns2.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
 
-  shared_ptr<Data> data = re.toData();
+  auto data = re.toData();
   m_keyChain.sign(*data, security::signingByCertificate(m_cert));
 
   Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
-  const Block& block = data->wireEncode();
   Name name;
-  name.append(block);
+  name.append(ndn::tlv::GenericNameComponent, data->wireEncode());
 
   q.setRrLabel(name);
   q.setRrType(label::NDNS_UPDATE_LABEL);
@@ -426,7 +419,7 @@
       block.parse();
       int ret = -1;
       BOOST_CHECK_EQUAL(block.type(), ndns::tlv::RrData);
-      Block::element_const_iterator val = block.elements_begin();
+      auto val = block.elements_begin();
       BOOST_CHECK_EQUAL(val->type(), ndns::tlv::UpdateReturnCode); // the first must be return code
       ret = readNonNegativeInteger(*val);
       BOOST_CHECK_EQUAL(ret, 0);
diff --git a/tests/unit/mgmt/management-tool.t.cpp b/tests/unit/mgmt/management-tool.t.cpp
index db2eaa0..97282d1 100644
--- a/tests/unit/mgmt/management-tool.t.cpp
+++ b/tests/unit/mgmt/management-tool.t.cpp
@@ -201,7 +201,6 @@
       }
     }
     NDN_THROW(Error("Certificate not found in keyChain"));
-    return rtn;
   }
 
   Certificate
@@ -1038,7 +1037,7 @@
   using security::transform::streamSink;
   using security::transform::bufferSource;
 
-  bufferSource(rrset1.getData().wire(), rrset1.getData().size()) >> base64Encode() >> streamSink(os);
+  bufferSource(rrset1.getData()) >> base64Encode() >> streamSink(os);
 
   std::string expectedValue = os.str();
 
