diff --git a/tests/chunks/consumer.t.cpp b/tests/chunks/consumer.t.cpp
index 32e6914..205cfb3 100644
--- a/tests/chunks/consumer.t.cpp
+++ b/tests/chunks/consumer.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2020, Regents of the University of California,
+ * Copyright (c) 2016-2022, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -75,8 +75,8 @@
     output.flush();
 
     auto data = makeData(Name(name).appendVersion(1).appendSegment(i));
-    data->setContent(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
-                     testStrings[i].size());
+    data->setContent(make_span(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
+                               testStrings[i].size()));
 
     cons.m_bufferedData[i] = data;
     cons.writeInOrderData();
@@ -109,8 +109,8 @@
 
   for (size_t i = 0; i < testStrings.size(); ++i) {
     auto data = makeData(Name(name).appendVersion(1).appendSegment(i));
-    data->setContent(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
-                     testStrings[i].size());
+    data->setContent(make_span(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
+                               testStrings[i].size()));
 
     dataStore.push_back(data);
   }
diff --git a/tests/dump/ndndump.t.cpp b/tests/dump/ndndump.t.cpp
index f266d92..217dc10 100644
--- a/tests/dump/ndndump.t.cpp
+++ b/tests/dump/ndndump.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020, University of Memphis,
+ * Copyright (c) 2014-2022, University of Memphis,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
@@ -87,9 +87,9 @@
     ethernet::Address host;
 
     // Ethernet header
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(&ethertype), ethernet::TYPE_LEN);
-    buffer.prependByteArray(host.data(), host.size());
-    buffer.prependByteArray(host.data(), host.size());
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(&ethertype), ethernet::TYPE_LEN});
+    buffer.prependBytes(host);
+    buffer.prependBytes(host);
 
     // pcap header
     pcap_pkthdr pkthdr{};
@@ -97,28 +97,28 @@
 
     {
       StdCoutRedirector redirect(output);
-      dump.printPacket(&pkthdr, buffer.buf());
+      dump.printPacket(&pkthdr, buffer.data());
     }
   }
 
   void
   receiveIp4(EncodingBuffer& buffer, const ip* ipHeader)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(ipHeader), sizeof(ip));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(ipHeader), sizeof(ip)});
     receiveEthernet(buffer, s_ethertypeIp4);
   }
 
   void
   receiveIp6(EncodingBuffer& buffer, const ip6_hdr* ip6Header)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(ip6Header), sizeof(ip6_hdr));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(ip6Header), sizeof(ip6_hdr)});
     receiveEthernet(buffer, s_ethertypeIp6);
   }
 
   void
   receiveTcp4(EncodingBuffer& buffer, const tcphdr* tcpHeader)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(tcpHeader), sizeof(tcphdr));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(tcpHeader), sizeof(tcphdr)});
 
     ip ipHeader{};
     ipHeader.ip_v = 4;
@@ -133,7 +133,7 @@
   void
   receiveUdp4(EncodingBuffer& buffer, const udphdr* udpHeader)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(udpHeader), sizeof(udphdr));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(udpHeader), sizeof(udphdr)});
 
     ip ipHeader{};
     ipHeader.ip_v = 4;
@@ -238,7 +238,7 @@
       0x00, 0x00, 0x00, 0x01
   };
   EncodingBuffer buffer;
-  buffer.prependByteArray(interest, 4);
+  buffer.prependBytes(make_span(interest).first(4));
 
   this->receiveEthernet(buffer);
   BOOST_CHECK(output.is_equal("0.000000 Ethernet, NDN truncated packet, length 4\n"));
@@ -268,7 +268,7 @@
   uint8_t theAnswer = 42;
 
   EncodingBuffer pkt1;
-  pkt1.prependByte(theAnswer);
+  pkt1.prependBytes({theAnswer});
   this->receiveEthernet(pkt1, s_ethertypeIp4);
   BOOST_CHECK(output.is_equal("IP truncated header, length 1\n"));
 
@@ -315,7 +315,7 @@
   uint8_t theAnswer = 42;
 
   EncodingBuffer pkt1;
-  pkt1.prependByte(theAnswer);
+  pkt1.prependBytes({theAnswer});
   this->receiveEthernet(pkt1, s_ethertypeIp6);
   BOOST_CHECK(output.is_equal("IP6 truncated header, length 1\n"));
 
diff --git a/tests/key-chain-fixture.cpp b/tests/key-chain-fixture.cpp
index b4911df..283c7bc 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) 2014-2020,  Regents of the University of California.
+ * Copyright (c) 2014-2022,  Regents of the University of California.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -54,7 +54,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/peek/ndnpeek.t.cpp b/tests/peek/ndnpeek.t.cpp
index 336b1de..dfb8768 100644
--- a/tests/peek/ndnpeek.t.cpp
+++ b/tests/peek/ndnpeek.t.cpp
@@ -143,8 +143,7 @@
   initialize(options);
 
   auto data = makeData(options.name);
-  const std::string payload = "NdnPeekTest";
-  data->setContent(reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
+  data->setContent({'n', 'd', 'n', 'p', 'e', 'e', 'k'});
 
   {
     CoutRedirector redir(output);
@@ -177,8 +176,7 @@
 
   auto data = makeData(Name(options.name).append("suffix"));
   data->setFreshnessPeriod(1_s);
-  const std::string payload = "NdnPeekTest";
-  data->setContent(reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
+  data->setContent({'n', 'd', 'n', 'p', 'e', 'e', 'k'});
 
   {
     CoutRedirector redir(output);
diff --git a/tools/chunks/putchunks/producer.cpp b/tools/chunks/putchunks/producer.cpp
index 0a39c3b..c353817 100644
--- a/tools/chunks/putchunks/producer.cpp
+++ b/tools/chunks/putchunks/producer.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2021, Regents of the University of California,
+ * Copyright (c) 2016-2022, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -41,7 +41,7 @@
   , m_keyChain(keyChain)
   , m_options(opts)
 {
-  if (prefix.size() > 0 && prefix[-1].isVersion()) {
+  if (!prefix.empty() && prefix[-1].isVersion()) {
     m_prefix = prefix.getPrefix(-1);
     m_versionedPrefix = prefix;
   }
@@ -115,7 +115,7 @@
 void
 Producer::processSegmentInterest(const Interest& interest)
 {
-  BOOST_ASSERT(m_store.size() > 0);
+  BOOST_ASSERT(!m_store.empty());
 
   if (m_options.isVerbose)
     std::cerr << "Interest: " << interest << "\n";
@@ -164,7 +164,7 @@
     if (nCharsRead > 0) {
       auto data = make_shared<Data>(Name(m_versionedPrefix).appendSegment(m_store.size()));
       data->setFreshnessPeriod(m_options.freshnessPeriod);
-      data->setContent(buffer.data(), static_cast<size_t>(nCharsRead));
+      data->setContent(make_span(buffer).first(nCharsRead));
       m_store.push_back(data);
     }
   }
diff --git a/tools/dump/ndndump.cpp b/tools/dump/ndndump.cpp
index ed7fd93..cb1583f 100644
--- a/tools/dump/ndndump.cpp
+++ b/tools/dump/ndndump.cpp
@@ -207,8 +207,7 @@
     shouldPrint = printPpp(out, payload, pkthdr->len);
     break;
   default:
-    BOOST_ASSERT(false);
-    return;
+    NDN_CXX_UNREACHABLE;
   }
 
   if (shouldPrint) {
@@ -220,9 +219,9 @@
 }
 
 void
-NdnDump::printTimestamp(std::ostream& os, const timeval& tv) const
+NdnDump::printTimestamp(std::ostream& os, const timeval& tv)
 {
-  /// \todo Add more timestamp formats (time since previous packet, time since first packet, ...)
+  // TODO: Add more timestamp formats (time since previous packet, time since first packet, ...)
   os << tv.tv_sec
      << "."
      << std::setfill('0') << std::setw(6) << tv.tv_usec
@@ -520,7 +519,7 @@
 
   bool isOk = false;
   Block block;
-  std::tie(isOk, block) = Block::fromBuffer(pkt, len);
+  std::tie(isOk, block) = Block::fromBuffer({pkt, len});
   if (!isOk) {
     // if packet is incomplete, we will not be able to process it
     out << "NDN truncated packet, length " << len;
@@ -549,8 +548,7 @@
       return true;
     }
 
-    bool isOk = false;
-    std::tie(isOk, netPacket) = Block::fromBuffer(&*begin, std::distance(begin, end));
+    std::tie(isOk, netPacket) = Block::fromBuffer({begin, end});
     if (!isOk) {
       // if network packet is fragmented, we will not be able to process it
       out << " fragment";
diff --git a/tools/dump/ndndump.hpp b/tools/dump/ndndump.hpp
index 58ba032..47a455a 100644
--- a/tools/dump/ndndump.hpp
+++ b/tools/dump/ndndump.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2011-2019, Regents of the University of California.
+ * Copyright (c) 2011-2022, Regents of the University of California.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -66,8 +66,8 @@
   }
 
 private:
-  void
-  printTimestamp(std::ostream& os, const timeval& tv) const;
+  static void
+  printTimestamp(std::ostream& os, const timeval& tv);
 
   bool
   dispatchByEtherType(OutputFormatter& out, const uint8_t* pkt, size_t len, uint16_t etherType) const;
