diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 7746db9..4e09a82 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -128,7 +128,11 @@
 
     def getGeneralFlags(self, conf):
         """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
-        return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
+        return {
+            'CXXFLAGS': [],
+            'LINKFLAGS': [],
+            'DEFINES': ['BOOST_ASIO_NO_DEPRECATED', 'BOOST_FILESYSTEM_NO_DEPRECATED'],
+        }
 
     def getDebugFlags(self, conf):
         """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
diff --git a/examples/data-producer.cpp b/examples/data-producer.cpp
index 2a23e9c..c564671 100644
--- a/examples/data-producer.cpp
+++ b/examples/data-producer.cpp
@@ -87,7 +87,7 @@
 
 private:
   ndn::Face m_face;
-  ndn::Scheduler m_scheduler{m_face.getIoService()};
+  ndn::Scheduler m_scheduler{m_face.getIoContext()};
   std::uniform_int_distribution<> m_randomDist{200, 1000};
 };
 
@@ -118,7 +118,7 @@
 Publisher::generateFromFile()
 {
   if (insertStream.eof()) {
-    m_face.getIoService().stop();
+    m_face.getIoContext().stop();
     return;
   }
 
diff --git a/src/handles/tcp-bulk-insert-handle.cpp b/src/handles/tcp-bulk-insert-handle.cpp
index 2713d03..cd26334 100644
--- a/src/handles/tcp-bulk-insert-handle.cpp
+++ b/src/handles/tcp-bulk-insert-handle.cpp
@@ -28,40 +28,39 @@
 namespace ip = boost::asio::ip;
 
 namespace repo {
-namespace detail {
+namespace {
 
 class TcpBulkInsertClient : noncopyable
 {
 public:
-  TcpBulkInsertClient(TcpBulkInsertHandle& writer, std::shared_ptr<ip::tcp::socket> socket)
+  TcpBulkInsertClient(TcpBulkInsertHandle& writer, ip::tcp::socket socket)
     : m_writer(writer)
     , m_socket(std::move(socket))
   {
   }
 
   static void
-  startReceive(TcpBulkInsertHandle& writer, std::shared_ptr<ip::tcp::socket> socket)
+  startReceive(TcpBulkInsertHandle& writer, ip::tcp::socket socket)
   {
     auto client = std::make_shared<TcpBulkInsertClient>(writer, std::move(socket));
-    client->m_socket->async_receive(
+    client->m_socket.async_receive(
       boost::asio::buffer(client->m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE), 0,
       std::bind(&TcpBulkInsertClient::handleReceive, client, _1, _2, client));
   }
 
 private:
   void
-  handleReceive(const boost::system::error_code& error,
-                std::size_t nBytesReceived,
+  handleReceive(const boost::system::error_code& error, std::size_t nBytesReceived,
                 const std::shared_ptr<TcpBulkInsertClient>& client);
 
 private:
   TcpBulkInsertHandle& m_writer;
-  std::shared_ptr<ip::tcp::socket> m_socket;
+  ip::tcp::socket m_socket;
   uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
   std::size_t m_inputBufferSize = 0;
 };
 
-} // namespace detail
+} // namespace
 
 TcpBulkInsertHandle::TcpBulkInsertHandle(boost::asio::io_context& io,
                                          RepoStorage& storageHandle)
@@ -74,14 +73,12 @@
 TcpBulkInsertHandle::listen(const std::string& host, const std::string& port)
 {
   ip::tcp::resolver resolver(m_acceptor.get_executor());
-  ip::tcp::resolver::query query(host, port);
+  boost::system::error_code ec;
+  auto results = resolver.resolve(host, port, ec);
+  if (ec)
+    NDN_THROW(Error("Cannot resolve " + host + ":" + port + " (" + ec.message() + ")"));
 
-  ip::tcp::resolver::iterator endpoint = resolver.resolve(query);
-  ip::tcp::resolver::iterator end;
-  if (endpoint == end)
-    NDN_THROW(Error("Cannot listen on " + host + " port " + port));
-
-  m_localEndpoint = *endpoint;
+  m_localEndpoint = *results.begin();
   NDN_LOG_DEBUG("Start listening on " << m_localEndpoint);
 
   m_acceptor.open(m_localEndpoint.protocol());
@@ -105,39 +102,31 @@
 void
 TcpBulkInsertHandle::asyncAccept()
 {
-  auto clientSocket = std::make_shared<ip::tcp::socket>(m_acceptor.get_executor());
-  m_acceptor.async_accept(*clientSocket,
-                          std::bind(&TcpBulkInsertHandle::handleAccept, this, _1, clientSocket));
+  m_acceptor.async_accept([this] (const auto& error, ip::tcp::socket socket) {
+    if (error) {
+      return;
+    }
+
+    NDN_LOG_DEBUG("New connection from " << socket.remote_endpoint());
+    TcpBulkInsertClient::startReceive(*this, std::move(socket));
+
+    // prepare accepting the next connection
+    asyncAccept();
+  });
 }
 
 void
-TcpBulkInsertHandle::handleAccept(const boost::system::error_code& error,
-                                  const std::shared_ptr<ip::tcp::socket>& socket)
+TcpBulkInsertClient::handleReceive(const boost::system::error_code& error,
+                                   std::size_t nBytesReceived,
+                                   const std::shared_ptr<TcpBulkInsertClient>& client)
 {
   if (error) {
-    return;
-  }
-
-  NDN_LOG_DEBUG("New connection from " << socket->remote_endpoint());
-
-  detail::TcpBulkInsertClient::startReceive(*this, socket);
-
-  // prepare accepting the next connection
-  asyncAccept();
-}
-
-void
-detail::TcpBulkInsertClient::handleReceive(const boost::system::error_code& error,
-                                           std::size_t nBytesReceived,
-                                           const std::shared_ptr<detail::TcpBulkInsertClient>& client)
-{
-  if (error) {
-    if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+    if (error == boost::asio::error::operation_aborted) // when socket is closed by someone
       return;
 
     boost::system::error_code ec;
-    m_socket->shutdown(ip::tcp::socket::shutdown_both, ec);
-    m_socket->close(ec);
+    m_socket.shutdown(ip::tcp::socket::shutdown_both, ec);
+    m_socket.close(ec);
     return;
   }
 
@@ -175,8 +164,8 @@
 
   if (!isOk && m_inputBufferSize == ndn::MAX_NDN_PACKET_SIZE && offset == 0) {
     boost::system::error_code ec;
-    m_socket->shutdown(ip::tcp::socket::shutdown_both, ec);
-    m_socket->close(ec);
+    m_socket.shutdown(ip::tcp::socket::shutdown_both, ec);
+    m_socket.close(ec);
     return;
   }
 
@@ -190,9 +179,9 @@
     }
   }
 
-  m_socket->async_receive(boost::asio::buffer(m_inputBuffer + m_inputBufferSize,
-                                              ndn::MAX_NDN_PACKET_SIZE - m_inputBufferSize), 0,
-                          std::bind(&TcpBulkInsertClient::handleReceive, this, _1, _2, client));
+  m_socket.async_receive(boost::asio::buffer(m_inputBuffer + m_inputBufferSize,
+                                             ndn::MAX_NDN_PACKET_SIZE - m_inputBufferSize), 0,
+                         std::bind(&TcpBulkInsertClient::handleReceive, this, _1, _2, client));
 }
 
 } // namespace repo
diff --git a/src/handles/tcp-bulk-insert-handle.hpp b/src/handles/tcp-bulk-insert-handle.hpp
index a0a8e7a..ab1ade7 100644
--- a/src/handles/tcp-bulk-insert-handle.hpp
+++ b/src/handles/tcp-bulk-insert-handle.hpp
@@ -55,10 +55,6 @@
   void
   asyncAccept();
 
-  void
-  handleAccept(const boost::system::error_code& error,
-               const std::shared_ptr<boost::asio::ip::tcp::socket>& socket);
-
 private:
   boost::asio::ip::tcp::acceptor m_acceptor;
   boost::asio::ip::tcp::endpoint m_localEndpoint;
diff --git a/tests/integrated/command-fixture.cpp b/tests/integrated/command-fixture.cpp
deleted file mode 100644
index 28990e3..0000000
--- a/tests/integrated/command-fixture.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2022, Regents of the University of California.
- *
- * This file is part of NDN repo-ng (Next generation of NDN repository).
- * See AUTHORS.md for complete list of repo-ng authors and contributors.
- *
- * repo-ng is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * repo-ng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * repo-ng, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "command-fixture.hpp"
-
-namespace repo::tests {
-
-CommandFixture::CommandFixture()
-  : scheduler(repoFace.getIoService())
-  , keyChain(m_keyChain)
-  , dispatcher(repoFace, keyChain)
-  , validator(repoFace)
-{
-  this->addIdentity("/ndn/test/repo");
-  this->saveIdentityCertificate("/ndn/test/repo", "tests/integrated/insert-delete-test.cert");
-  validator.load("tests/integrated/insert-delete-validator-config.conf");
-}
-
-} // namespace repo::tests
diff --git a/tests/integrated/command-fixture.hpp b/tests/integrated/command-fixture.hpp
index 6d4aa44..507a9f1 100644
--- a/tests/integrated/command-fixture.hpp
+++ b/tests/integrated/command-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022, Regents of the University of California.
+ * Copyright (c) 2014-2023, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -30,15 +30,19 @@
 class CommandFixture : public virtual IdentityManagementFixture
 {
 protected:
-  CommandFixture();
+  CommandFixture()
+  {
+    addIdentity("/ndn/test/repo");
+    saveIdentityCertificate("/ndn/test/repo", "tests/integrated/insert-delete-test.cert");
+    validator.load("tests/integrated/insert-delete-validator-config.conf");
+  }
 
 protected:
   Face repoFace;
-  Scheduler scheduler;
-  ndn::KeyChain& keyChain;
-  ndn::mgmt::Dispatcher dispatcher;
+  Scheduler scheduler{repoFace.getIoContext()};
+  ndn::mgmt::Dispatcher dispatcher{repoFace, m_keyChain};
   /// \todo #4091 switch to ValidatorPolicyConf and load insert-delete-validator-config.conf
-  ndn::security::ValidatorConfig validator;
+  ndn::security::ValidatorConfig validator{repoFace};
 };
 
 } // namespace repo::tests
diff --git a/tests/integrated/test-basic-command-insert-delete.cpp b/tests/integrated/test-basic-command-insert-delete.cpp
index 0f868eb..f1a9110 100644
--- a/tests/integrated/test-basic-command-insert-delete.cpp
+++ b/tests/integrated/test-basic-command-insert-delete.cpp
@@ -50,9 +50,9 @@
   Fixture()
     : writeHandle(repoFace, *handle, dispatcher, scheduler, validator)
     , deleteHandle(repoFace, *handle, dispatcher, scheduler, validator)
-    , insertFace(repoFace.getIoService())
-    , deleteFace(repoFace.getIoService())
-    , signer(keyChain)
+    , insertFace(repoFace.getIoContext())
+    , deleteFace(repoFace.getIoContext())
+    , signer(m_keyChain)
   {
     Name cmdPrefix("/repo/command");
     repoFace.registerPrefix(cmdPrefix, nullptr,
@@ -114,11 +114,11 @@
 void
 Fixture<T>::onInsertInterest(const Interest& interest)
 {
-  Data data(Name(interest.getName()));
+  Data data(interest.getName());
   data.setContent(CONTENT);
-  data.setFreshnessPeriod(0_ms);
-  keyChain.sign(data);
+  m_keyChain.sign(data);
   insertFace.put(data);
+
   auto eventIt = insertEvents.find(interest.getName());
   if (eventIt != insertEvents.end()) {
     eventIt->second.cancel();
diff --git a/tests/integrated/test-basic-interest-read.cpp b/tests/integrated/test-basic-interest-read.cpp
index 81ceb98..c2b6a17 100644
--- a/tests/integrated/test-basic-interest-read.cpp
+++ b/tests/integrated/test-basic-interest-read.cpp
@@ -38,15 +38,15 @@
 {
 public:
   BasicInterestReadFixture()
-    : scheduler(repoFace.getIoService())
+    : scheduler(repoFace.getIoContext())
     , readHandle(repoFace, *handle, 0)
-    , readFace(repoFace.getIoService())
+    , readFace(repoFace.getIoContext())
   {
   }
 
   ~BasicInterestReadFixture()
   {
-    repoFace.getIoService().stop();
+    repoFace.getIoContext().stop();
   }
 
   void
diff --git a/tests/unit/read-handle.t.cpp b/tests/unit/read-handle.t.cpp
index 9d36b18..553f651 100644
--- a/tests/unit/read-handle.t.cpp
+++ b/tests/unit/read-handle.t.cpp
@@ -44,7 +44,7 @@
 public:
   Fixture()
     : face({true, true})
-    , scheduler(face.getIoService())
+    , scheduler(face.getIoContext())
     , subsetLength(1)
     , dataPrefix("/ndn/test/prefix")
     , identity("/ndn/test/identity")
diff --git a/tests/unit/tcp-bulk-insert-handle.cpp b/tests/unit/tcp-bulk-insert-handle.cpp
index 9c0398b..e227167 100644
--- a/tests/unit/tcp-bulk-insert-handle.cpp
+++ b/tests/unit/tcp-bulk-insert-handle.cpp
@@ -18,10 +18,11 @@
  */
 
 #include "handles/tcp-bulk-insert-handle.hpp"
-#include "storage/sqlite-storage.hpp"
+
 #include "../repo-storage-fixture.hpp"
 #include "../dataset-fixtures.hpp"
 
+#include <boost/asio/ip/tcp.hpp>
 #include <boost/test/unit_test.hpp>
 
 namespace repo::tests {
@@ -34,28 +35,21 @@
   void
   start(const std::string& host, const std::string& port)
   {
-    using namespace boost::asio;
-
-    ip::tcp::resolver resolver(ioCtx);
-    ip::tcp::resolver::query query(host, port);
-
-    ip::tcp::resolver::iterator endpoint = resolver.resolve(query);
-    ip::tcp::resolver::iterator end;
-
-    if (endpoint == end)
+    boost::asio::ip::tcp::resolver resolver(ioCtx);
+    boost::system::error_code ec;
+    auto results = resolver.resolve(host, port, ec);
+    if (ec) {
       BOOST_FAIL("Cannot resolve [" + host + ":" + port + "]");
+    }
 
-    ip::tcp::endpoint serverEndpoint = *endpoint;
-
-    socket.async_connect(serverEndpoint,
-                         std::bind(&TcpClient::onSuccessfullConnect, this, _1));
+    socket.async_connect(*results.begin(), std::bind(&TcpClient::handleConnect, this, _1));
   }
 
   virtual void
-  onSuccessfullConnect(const boost::system::error_code& error)
+  handleConnect(const boost::system::error_code& error)
   {
     if (error) {
-      BOOST_FAIL("TCP connection aborted");
+      BOOST_FAIL("TCP connection failed");
     }
   }
 
@@ -78,9 +72,9 @@
   }
 
   void
-  onSuccessfullConnect(const boost::system::error_code& error) override
+  handleConnect(const boost::system::error_code& error) override
   {
-    TcpClient::onSuccessfullConnect(error);
+    TcpClient::handleConnect(error);
 
     // This value may need to be adjusted if some dataset exceeds 100k
     socket.set_option(boost::asio::socket_base::send_buffer_size(100000));
diff --git a/tools/ndnputfile.cpp b/tools/ndnputfile.cpp
index 04e85ee..b011c71 100644
--- a/tools/ndnputfile.cpp
+++ b/tools/ndnputfile.cpp
@@ -72,7 +72,7 @@
     , timeout(0)
     , insertStream(nullptr)
     , isVerbose(false)
-    , m_scheduler(m_face.getIoService())
+    , m_scheduler(m_face.getIoContext())
     , m_timestampVersion(toUnixTimestamp(system_clock::now()).count())
     , m_processId(0)
     , m_checkPeriod(DEFAULT_CHECK_PERIOD)
@@ -111,9 +111,6 @@
   onRegisterFailed(const ndn::Name& prefix, const std::string& reason);
 
   void
-  stopProcess();
-
-  void
   signData(ndn::Data& data);
 
   void
@@ -222,7 +219,7 @@
                            bind(&NdnPutFile::onRegisterFailed, this, _1, _2));
 
   if (hasTimeout)
-    m_scheduler.schedule(timeout, [this] { stopProcess(); });
+    m_scheduler.schedule(timeout, [this] { m_face.getIoContext().stop(); });
 
   m_face.processEvents();
 }
@@ -349,12 +346,6 @@
 }
 
 void
-NdnPutFile::stopProcess()
-{
-  m_face.getIoService().stop();
-}
-
-void
 NdnPutFile::signData(ndn::Data& data)
 {
   if (useDigestSha256) {
@@ -393,7 +384,7 @@
 
     if (isSingle) {
       if (insertCount == 1) {
-        m_face.getIoService().stop();
+        m_face.getIoContext().stop();
         return;
       }
     }
@@ -401,7 +392,7 @@
     // write operation has been finished
 
     if (insertCount == m_currentSegmentNo) {
-      m_face.getIoService().stop();
+      m_face.getIoContext().stop();
       return;
     }
   }
