diff --git a/tests/unit/security/pib/identity-container.t.cpp b/tests/unit/security/pib/identity-container.t.cpp
index fb5e9cc..77503a0 100644
--- a/tests/unit/security/pib/identity-container.t.cpp
+++ b/tests/unit/security/pib/identity-container.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2022 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -21,7 +21,6 @@
 
 #include "ndn-cxx/security/pib/identity-container.hpp"
 #include "ndn-cxx/security/pib/impl/pib-memory.hpp"
-#include "ndn-cxx/security/pib/pib.hpp"
 
 #include "tests/boost-test.hpp"
 #include "tests/unit/security/pib/pib-data-fixture.hpp"
@@ -37,78 +36,75 @@
 BOOST_AUTO_TEST_SUITE(Pib)
 BOOST_FIXTURE_TEST_SUITE(TestIdentityContainer, PibDataFixture)
 
-using pib::Pib;
-
-BOOST_AUTO_TEST_CASE(Basic)
+BOOST_AUTO_TEST_CASE(AddGetRemove)
 {
   auto pibImpl = make_shared<PibMemory>();
 
-  // start with an empty container
-  IdentityContainer container(pibImpl);
-  BOOST_CHECK_EQUAL(container.size(), 0);
-  BOOST_CHECK_EQUAL(container.getLoadedIdentities().size(), 0);
+  {
+    // start with an empty container
+    IdentityContainer container(pibImpl);
+    BOOST_CHECK_EQUAL(container.size(), 0);
+    BOOST_CHECK_EQUAL(container.m_identities.size(), 0);
 
-  // add the first identity
-  Identity identity11 = container.add(id1);
-  BOOST_CHECK_EQUAL(identity11.getName(), id1);
-  BOOST_CHECK_EQUAL(container.size(), 1);
-  BOOST_CHECK_EQUAL(container.getLoadedIdentities().size(), 1);
-  BOOST_CHECK(container.find(id1) != container.end());
+    // add the first identity
+    Identity identity11 = container.add(id1);
+    BOOST_CHECK_EQUAL(identity11.getName(), id1);
+    BOOST_CHECK_EQUAL(container.size(), 1);
+    BOOST_CHECK_EQUAL(container.m_identities.size(), 1);
+    BOOST_CHECK(container.find(id1) != container.end());
 
-  // add the same identity again
-  Identity identity12 = container.add(id1);
-  BOOST_CHECK_EQUAL(identity12.getName(), id1);
-  BOOST_CHECK_EQUAL(container.size(), 1);
-  BOOST_CHECK_EQUAL(container.getLoadedIdentities().size(), 1);
-  BOOST_CHECK(container.find(id1) != container.end());
+    // add the same identity again
+    Identity identity12 = container.add(id1);
+    BOOST_CHECK_EQUAL(identity12.getName(), id1);
+    BOOST_CHECK_EQUAL(container.size(), 1);
+    BOOST_CHECK_EQUAL(container.m_identities.size(), 1);
+    BOOST_CHECK(container.find(id1) != container.end());
 
-  // add the second identity
-  Identity identity21 = container.add(id2);
-  BOOST_CHECK_EQUAL(identity21.getName(), id2);
-  BOOST_CHECK_EQUAL(container.size(), 2);
-  BOOST_CHECK_EQUAL(container.getLoadedIdentities().size(), 2);
-  BOOST_CHECK(container.find(id1) != container.end());
-  BOOST_CHECK(container.find(id2) != container.end());
+    // add the second identity
+    Identity identity21 = container.add(id2);
+    BOOST_CHECK_EQUAL(identity21.getName(), id2);
+    BOOST_CHECK_EQUAL(container.size(), 2);
+    BOOST_CHECK_EQUAL(container.m_identities.size(), 2);
+    BOOST_CHECK(container.find(id1) != container.end());
+    BOOST_CHECK(container.find(id2) != container.end());
 
-  // get identities
-  BOOST_REQUIRE_NO_THROW(container.get(id1));
-  BOOST_REQUIRE_NO_THROW(container.get(id2));
-  BOOST_CHECK_THROW(container.get(Name("/non-existing")), Pib::Error);
+    // check identities
+    Identity identity1 = container.get(id1);
+    Identity identity2 = container.get(id2);
+    BOOST_CHECK_EQUAL(identity1.getName(), id1);
+    BOOST_CHECK_EQUAL(identity2.getName(), id2);
+    BOOST_CHECK_THROW(container.get(Name("/non-existing")), pib::Pib::Error);
+  }
 
-  // check identity
-  Identity identity1 = container.get(id1);
-  Identity identity2 = container.get(id2);
-  BOOST_CHECK_EQUAL(identity1.getName(), id1);
-  BOOST_CHECK_EQUAL(identity2.getName(), id2);
+  {
+    // create a container from an existing (non-empty) PibImpl
+    // names are loaded immediately but identity cache should initially be empty
+    IdentityContainer container2(pibImpl);
+    BOOST_CHECK_EQUAL(container2.size(), 2);
+    BOOST_CHECK_EQUAL(container2.m_identities.size(), 0);
 
-  // create another container from the same PibImpl
-  // cache should be empty
-  IdentityContainer container2(pibImpl);
-  BOOST_CHECK_EQUAL(container2.size(), 2);
-  BOOST_CHECK_EQUAL(container2.getLoadedIdentities().size(), 0);
+    // fetching the identities should populate the cache
+    BOOST_CHECK_EQUAL(container2.get(id1).getName(), id1);
+    BOOST_CHECK_EQUAL(container2.size(), 2);
+    BOOST_CHECK_EQUAL(container2.m_identities.size(), 1);
 
-  // get key, cache should be filled
-  BOOST_REQUIRE_NO_THROW(container2.get(id1));
-  BOOST_CHECK_EQUAL(container2.size(), 2);
-  BOOST_CHECK_EQUAL(container2.getLoadedIdentities().size(), 1);
+    BOOST_CHECK_EQUAL(container2.get(id2).getName(), id2);
+    BOOST_CHECK_EQUAL(container2.size(), 2);
+    BOOST_CHECK_EQUAL(container2.m_identities.size(), 2);
 
-  BOOST_REQUIRE_NO_THROW(container2.get(id2));
-  BOOST_CHECK_EQUAL(container2.size(), 2);
-  BOOST_CHECK_EQUAL(container2.getLoadedIdentities().size(), 2);
+    // remove an identity
+    container2.remove(id1);
+    BOOST_CHECK_EQUAL(container2.size(), 1);
+    BOOST_CHECK_EQUAL(container2.m_identities.size(), 1);
+    BOOST_CHECK(container2.find(id1) == container2.end());
+    BOOST_CHECK(container2.find(id2) != container2.end());
 
-  // remove a key
-  container2.remove(id1);
-  BOOST_CHECK_EQUAL(container2.size(), 1);
-  BOOST_CHECK_EQUAL(container2.getLoadedIdentities().size(), 1);
-  BOOST_CHECK(container2.find(id1) == container2.end());
-  BOOST_CHECK(container2.find(id2) != container2.end());
-
-  // remove another key
-  container2.remove(id2);
-  BOOST_CHECK_EQUAL(container2.size(), 0);
-  BOOST_CHECK_EQUAL(container2.getLoadedIdentities().size(), 0);
-  BOOST_CHECK(container2.find(id2) == container2.end());
-
+    // remove another identity
+    container2.remove(id2);
+    BOOST_CHECK_EQUAL(container2.size(), 0);
+    BOOST_CHECK_EQUAL(container2.m_identities.size(), 0);
+    BOOST_CHECK(container2.find(id2) == container2.end());
+  }
 }
 
 BOOST_AUTO_TEST_CASE(Iterator)
@@ -118,12 +114,10 @@
   container.add(id1);
   container.add(id2);
 
-  std::set<Name> idNames;
-  idNames.insert(id1);
-  idNames.insert(id2);
+  const std::set<Name> idNames{id1, id2};
 
   IdentityContainer::const_iterator it = container.begin();
-  std::set<Name>::const_iterator testIt = idNames.begin();
+  auto testIt = idNames.begin();
   BOOST_CHECK_EQUAL((*it).getName(), *testIt);
   it++;
   testIt++;
@@ -132,7 +126,8 @@
   testIt++;
   BOOST_CHECK(it == container.end());
 
-  size_t count = 0;
+  // test range-based for
+  int count = 0;
   testIt = idNames.begin();
   for (const auto& identity : container) {
     BOOST_CHECK_EQUAL(identity.getName(), *testIt);
diff --git a/tests/unit/security/pib/identity.t.cpp b/tests/unit/security/pib/identity.t.cpp
index 0198816..97f2369 100644
--- a/tests/unit/security/pib/identity.t.cpp
+++ b/tests/unit/security/pib/identity.t.cpp
@@ -41,34 +41,41 @@
 BOOST_AUTO_TEST_CASE(ValidityChecking)
 {
   Identity id;
-  BOOST_CHECK(!id);
-  BOOST_CHECK_EQUAL(static_cast<bool>(id), false);
+  BOOST_TEST(!id);
+  BOOST_TEST(id == Identity());
 
-  auto identityImpl = make_shared<detail::IdentityImpl>(id1, make_shared<PibMemory>(), true);
-  id = Identity(identityImpl);
-  BOOST_CHECK(id);
-  BOOST_CHECK_EQUAL(!id, false);
+  auto impl = std::make_shared<detail::IdentityImpl>(id1, std::make_shared<PibMemory>(), true);
+  id = Identity(impl);
+  BOOST_TEST(id);
+  BOOST_TEST(id != Identity());
+
+  impl.reset();
+  BOOST_TEST(!id);
 }
 
-// pib::Identity is a wrapper of pib::detail::IdentityImpl.  Since the functionalities of
-// IdentityImpl have already been tested in detail/identity-impl.t.cpp, we only test the shared
+// pib::Identity is a wrapper of pib::detail::IdentityImpl. Since the functionality
+// of IdentityImpl is already tested in identity-impl.t.cpp, we only test the shared
 // property of pib::Identity in this test case.
 BOOST_AUTO_TEST_CASE(SharedImpl)
 {
-  auto identityImpl = make_shared<detail::IdentityImpl>(id1, make_shared<pib::PibMemory>(), true);
-  Identity identity1(identityImpl);
-  Identity identity2(identityImpl);
-  BOOST_CHECK_EQUAL(identity1, identity2);
-  BOOST_CHECK_NE(identity1, Identity());
-  BOOST_CHECK_EQUAL(Identity(), Identity());
+  auto impl = std::make_shared<detail::IdentityImpl>(id1, std::make_shared<pib::PibMemory>(), true);
+  Identity identity1(impl);
+  Identity identity2(impl);
 
+  BOOST_TEST(identity1 == identity2);
+  BOOST_TEST(identity1 != Identity());
+  BOOST_TEST(Identity() != identity2);
+  BOOST_TEST(Identity() == Identity());
+
+  BOOST_CHECK_THROW(identity2.getKey(id1Key1Name), pib::Pib::Error);
   identity1.addKey(id1Key1, id1Key1Name);
-  BOOST_CHECK_NO_THROW(identity2.getKey(id1Key1Name));
+  BOOST_TEST(identity2.getKey(id1Key1Name));
+
   identity2.removeKey(id1Key1Name);
   BOOST_CHECK_THROW(identity1.getKey(id1Key1Name), pib::Pib::Error);
 
   identity1.setDefaultKey(id1Key1, id1Key1Name);
-  BOOST_CHECK_NO_THROW(identity2.getDefaultKey());
+  BOOST_TEST(identity2.getDefaultKey().getName() == id1Key1Name);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestIdentity
diff --git a/tests/unit/security/pib/impl/identity-impl.t.cpp b/tests/unit/security/pib/impl/identity-impl.t.cpp
index 1b4527f..390cee4 100644
--- a/tests/unit/security/pib/impl/identity-impl.t.cpp
+++ b/tests/unit/security/pib/impl/identity-impl.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2022 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -36,19 +36,17 @@
 BOOST_AUTO_TEST_SUITE(Pib)
 BOOST_FIXTURE_TEST_SUITE(TestIdentityImpl, ndn::security::tests::PibDataFixture)
 
-using security::Pib;
+using pib::Pib;
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
-  auto pibImpl = make_shared<pib::PibMemory>();
-  IdentityImpl identity1(id1, pibImpl, true);
-
+  IdentityImpl identity1(id1, std::make_shared<pib::PibMemory>(), true);
   BOOST_CHECK_EQUAL(identity1.getName(), id1);
 }
 
-BOOST_AUTO_TEST_CASE(KeyOperation)
+BOOST_AUTO_TEST_CASE(KeyOperations)
 {
-  auto pibImpl = make_shared<pib::PibMemory>();
+  auto pibImpl = std::make_shared<pib::PibMemory>();
   IdentityImpl identity1(id1, pibImpl, true);
   BOOST_CHECK_NO_THROW(IdentityImpl(id1, pibImpl, false));
 
@@ -60,18 +58,18 @@
   // get default key, throw Pib::Error
   BOOST_CHECK_THROW(identity1.getDefaultKey(), Pib::Error);
   // set non-existing key as default key, throw Pib::Error
-  BOOST_REQUIRE_THROW(identity1.setDefaultKey(id1Key1Name), Pib::Error);
+  BOOST_CHECK_THROW(identity1.setDefaultKey(id1Key1Name), Pib::Error);
 
   // add key
   identity1.addKey(id1Key1, id1Key1Name);
-  BOOST_CHECK_NO_THROW(identity1.getKey(id1Key1Name));
+  const auto& addedKey = identity1.getKey(id1Key1Name);
+  BOOST_CHECK_EQUAL(addedKey.getName(), id1Key1Name);
+  BOOST_TEST(addedKey.getPublicKey() == id1Key1, boost::test_tools::per_element());
 
   // new key becomes default key when there is no default key
-  BOOST_REQUIRE_NO_THROW(identity1.getDefaultKey());
-  const Key& defaultKey0 = identity1.getDefaultKey();
+  const auto& defaultKey0 = identity1.getDefaultKey();
   BOOST_CHECK_EQUAL(defaultKey0.getName(), id1Key1Name);
-  BOOST_CHECK_EQUAL_COLLECTIONS(defaultKey0.getPublicKey().begin(), defaultKey0.getPublicKey().end(),
-                                id1Key1.begin(), id1Key1.end());
+  BOOST_TEST(defaultKey0.getPublicKey() == id1Key1, boost::test_tools::per_element());
 
   // remove key
   identity1.removeKey(id1Key1Name);
@@ -80,14 +78,9 @@
 
   // set default key directly
   BOOST_REQUIRE_NO_THROW(identity1.setDefaultKey(id1Key1, id1Key1Name));
-  BOOST_REQUIRE_NO_THROW(identity1.getDefaultKey());
-  BOOST_CHECK_NO_THROW(identity1.getKey(id1Key1Name));
-
-  // check default key
-  const Key& defaultKey1 = identity1.getDefaultKey();
+  const auto& defaultKey1 = identity1.getDefaultKey();
   BOOST_CHECK_EQUAL(defaultKey1.getName(), id1Key1Name);
-  BOOST_CHECK_EQUAL_COLLECTIONS(defaultKey1.getPublicKey().begin(), defaultKey1.getPublicKey().end(),
-                                id1Key1.begin(), id1Key1.end());
+  BOOST_TEST(defaultKey1.getPublicKey() == id1Key1, boost::test_tools::per_element());
 
   // add another key
   identity1.addKey(id1Key2, id1Key2Name);
@@ -95,11 +88,9 @@
 
   // set default key through name
   BOOST_REQUIRE_NO_THROW(identity1.setDefaultKey(id1Key2Name));
-  BOOST_REQUIRE_NO_THROW(identity1.getDefaultKey());
-  const Key& defaultKey2 = identity1.getDefaultKey();
+  const auto& defaultKey2 = identity1.getDefaultKey();
   BOOST_CHECK_EQUAL(defaultKey2.getName(), id1Key2Name);
-  BOOST_CHECK_EQUAL_COLLECTIONS(defaultKey2.getPublicKey().begin(), defaultKey2.getPublicKey().end(),
-                                id1Key2.begin(), id1Key2.end());
+  BOOST_TEST(defaultKey2.getPublicKey() == id1Key2, boost::test_tools::per_element());
 
   // remove key
   identity1.removeKey(id1Key1Name);
@@ -108,10 +99,9 @@
 
   // set default key directly again, change the default setting
   BOOST_REQUIRE_NO_THROW(identity1.setDefaultKey(id1Key1, id1Key1Name));
-  const Key& defaultKey3 = identity1.getDefaultKey();
+  const auto& defaultKey3 = identity1.getDefaultKey();
   BOOST_CHECK_EQUAL(defaultKey3.getName(), id1Key1Name);
-  BOOST_CHECK_EQUAL_COLLECTIONS(defaultKey3.getPublicKey().begin(), defaultKey3.getPublicKey().end(),
-                                id1Key1.begin(), id1Key1.end());
+  BOOST_TEST(defaultKey3.getPublicKey() == id1Key1, boost::test_tools::per_element());
   BOOST_CHECK_EQUAL(identity1.getKeys().size(), 2);
 
   // remove all keys
@@ -126,23 +116,20 @@
 
 BOOST_AUTO_TEST_CASE(Overwrite)
 {
-  auto pibImpl = make_shared<pib::PibMemory>();
-  IdentityImpl identity1(id1, pibImpl, true);
+  IdentityImpl identity1(id1, std::make_shared<pib::PibMemory>(), true);
 
   identity1.addKey(id1Key1, id1Key1Name);
   auto k1 = identity1.getKey(id1Key1Name);
-  BOOST_CHECK_EQUAL_COLLECTIONS(k1.getPublicKey().begin(), k1.getPublicKey().end(),
-                                id1Key1.begin(), id1Key1.end());
+  BOOST_TEST(k1.getPublicKey() == id1Key1, boost::test_tools::per_element());
 
   identity1.addKey(id1Key2, id1Key1Name); // overwriting key should work
   auto k2 = identity1.getKey(id1Key1Name);
-  BOOST_CHECK_EQUAL_COLLECTIONS(k2.getPublicKey().begin(), k2.getPublicKey().end(),
-                                id1Key2.begin(), id1Key2.end());
+  BOOST_TEST(k2.getPublicKey() == id1Key2, boost::test_tools::per_element());
 }
 
 BOOST_AUTO_TEST_CASE(Errors)
 {
-  auto pibImpl = make_shared<pib::PibMemory>();
+  auto pibImpl = std::make_shared<pib::PibMemory>();
 
   BOOST_CHECK_THROW(IdentityImpl(id1, pibImpl, false), Pib::Error);
   IdentityImpl identity1(id1, pibImpl, true);
