diff --git a/src/security/pib/key-container.cpp b/src/security/pib/key-container.cpp
index 4084cd3..7dc8358 100644
--- a/src/security/pib/key-container.cpp
+++ b/src/security/pib/key-container.cpp
@@ -71,7 +71,7 @@
   bool isOtherEnd = other.m_container == nullptr || other.m_it == other.m_container->m_keyNames.end();
   return ((isThisEnd || isOtherEnd) ?
           (isThisEnd == isOtherEnd) :
-          m_container->m_impl == other.m_container->m_impl && m_it == other.m_it);
+          m_container->m_pib == other.m_container->m_pib && m_it == other.m_it);
 }
 
 bool
@@ -80,12 +80,12 @@
   return !(*this == other);
 }
 
-KeyContainer::KeyContainer(const Name& identity, shared_ptr<PibImpl> impl)
+KeyContainer::KeyContainer(const Name& identity, shared_ptr<PibImpl> pibImpl)
   : m_identity(identity)
-  , m_impl(impl)
+  , m_pib(std::move(pibImpl))
 {
-  BOOST_ASSERT(impl != nullptr);
-  m_keyNames = impl->getKeysOfIdentity(identity);
+  BOOST_ASSERT(m_pib != nullptr);
+  m_keyNames = m_pib->getKeysOfIdentity(identity);
 }
 
 KeyContainer::const_iterator
@@ -121,7 +121,7 @@
   }
 
   m_keyNames.insert(keyName);
-  m_keys[keyName] = shared_ptr<detail::KeyImpl>(new detail::KeyImpl(keyName, key, keyLen, m_impl));
+  m_keys[keyName] = shared_ptr<detail::KeyImpl>(new detail::KeyImpl(keyName, key, keyLen, m_pib));
 
   return get(keyName);
 }
@@ -136,7 +136,7 @@
 
   m_keyNames.erase(keyName);
   m_keys.erase(keyName);
-  m_impl->removeKey(keyName);
+  m_pib->removeKey(keyName);
 }
 
 Key
@@ -154,7 +154,7 @@
     key = it->second;
   }
   else {
-    key = shared_ptr<detail::KeyImpl>(new detail::KeyImpl(keyName, m_impl));
+    key = shared_ptr<detail::KeyImpl>(new detail::KeyImpl(keyName, m_pib));
     m_keys[keyName] = key;
   }
 
@@ -164,7 +164,7 @@
 bool
 KeyContainer::isConsistent() const
 {
-  return m_keyNames == m_impl->getKeysOfIdentity(m_identity);
+  return m_keyNames == m_pib->getKeysOfIdentity(m_identity);
 }
 
 } // namespace pib
