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();
 
