diff --git a/src/data.cpp b/src/data.cpp
index 090b82d..169d99c 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -263,10 +263,10 @@
 }
 
 Data&
-Data::setContent(const ConstBufferPtr& value)
+Data::setContent(ConstBufferPtr value)
 {
   resetWire();
-  m_content = Block(tlv::Content, value);
+  m_content = Block(tlv::Content, std::move(value));
   return *this;
 }
 
diff --git a/src/data.hpp b/src/data.hpp
index d70f509..56f98ed 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -181,7 +181,7 @@
    *  @return a reference to this Data, to allow chaining
    */
   Data&
-  setContent(const ConstBufferPtr& value);
+  setContent(ConstBufferPtr value);
 
   /** @brief Get Signature
    */
diff --git a/src/detail/pending-interest.hpp b/src/detail/pending-interest.hpp
index 2a4da87..a4f643f 100644
--- a/src/detail/pending-interest.hpp
+++ b/src/detail/pending-interest.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -22,6 +22,8 @@
 #ifndef NDN_DETAIL_PENDING_INTEREST_HPP
 #define NDN_DETAIL_PENDING_INTEREST_HPP
 
+#include "../face.hpp"
+
 #include "../data.hpp"
 #include "../interest.hpp"
 #include "../lp/nack.hpp"
diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp
index 1aa9756..fc9a0dc 100644
--- a/src/encoding/block.cpp
+++ b/src/encoding/block.cpp
@@ -191,14 +191,15 @@
 std::tuple<bool, Block>
 Block::fromBuffer(ConstBufferPtr buffer, size_t offset)
 {
-  const Buffer::const_iterator begin = buffer->begin() + offset;
-  Buffer::const_iterator pos = begin;
+  auto begin = buffer->begin() + offset;
+  auto pos = begin;
 
   uint32_t type = 0;
   bool isOk = tlv::readType(pos, buffer->end(), type);
   if (!isOk) {
     return std::make_tuple(false, Block());
   }
+
   uint64_t length = 0;
   isOk = tlv::readVarNumber(pos, buffer->end(), length);
   if (!isOk) {
@@ -210,7 +211,7 @@
     return std::make_tuple(false, Block());
   }
 
-  return std::make_tuple(true, Block(buffer, type, begin, pos + length, pos, pos + length));
+  return std::make_tuple(true, Block(std::move(buffer), type, begin, pos + length, pos, pos + length));
 }
 
 std::tuple<bool, Block>
diff --git a/src/face.cpp b/src/face.cpp
index cf1e69d..abdd93b 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -322,18 +322,16 @@
     }
 
     if (timeout > time::milliseconds::zero()) {
-      boost::asio::io_service& ioService = m_ioService;
-      unique_ptr<boost::asio::io_service::work>& work = m_impl->m_ioServiceWork;
       m_impl->m_processEventsTimeoutEvent = m_impl->m_scheduler.scheduleEvent(timeout,
-        [&ioService, &work] {
-          ioService.stop();
+        [&io = m_ioService, &work = m_impl->m_ioServiceWork] {
+          io.stop();
           work.reset();
         });
     }
 
     if (keepThread) {
       // work will ensure that m_ioService is running until work object exists
-      m_impl->m_ioServiceWork.reset(new boost::asio::io_service::work(m_ioService));
+      m_impl->m_ioServiceWork = make_unique<boost::asio::io_service::work>(m_ioService);
     }
 
     m_ioService.run();
diff --git a/src/mgmt/nfd/controller.cpp b/src/mgmt/nfd/controller.cpp
index 7ed8005..1af70b7 100644
--- a/src/mgmt/nfd/controller.cpp
+++ b/src/mgmt/nfd/controller.cpp
@@ -22,7 +22,6 @@
 #include "controller.hpp"
 #include "face.hpp"
 #include "security/v2/key-chain.hpp"
-#include "security/validator-null.hpp"
 #include "util/segment-fetcher.hpp"
 
 #include <boost/lexical_cast.hpp>
@@ -49,28 +48,25 @@
 void
 Controller::startCommand(const shared_ptr<ControlCommand>& command,
                          const ControlParameters& parameters,
-                         const CommandSucceedCallback& onSuccess1,
-                         const CommandFailCallback& onFailure1,
+                         const CommandSucceedCallback& onSuccess,
+                         const CommandFailCallback& onFailure,
                          const CommandOptions& options)
 {
-  const CommandSucceedCallback& onSuccess = onSuccess1 ?
-    onSuccess1 : [] (const ControlParameters&) {};
-  const CommandFailCallback& onFailure = onFailure1 ?
-    onFailure1 : [] (const ControlResponse&) {};
-
   Name requestName = command->getRequestName(options.getPrefix(), parameters);
   Interest interest = m_signer.makeCommandInterest(requestName, options.getSigningInfo());
   interest.setInterestLifetime(options.getTimeout());
 
   m_face.expressInterest(interest,
     [=] (const Interest&, const Data& data) {
-      this->processCommandResponse(data, command, onSuccess, onFailure);
+      processCommandResponse(data, command, onSuccess, onFailure);
     },
     [=] (const Interest&, const lp::Nack&) {
-      onFailure(ControlResponse(Controller::ERROR_NACK, "network Nack received"));
+      if (onFailure)
+        onFailure(ControlResponse(Controller::ERROR_NACK, "network Nack received"));
     },
     [=] (const Interest&) {
-      onFailure(ControlResponse(Controller::ERROR_TIMEOUT, "request timed out"));
+      if (onFailure)
+        onFailure(ControlResponse(Controller::ERROR_TIMEOUT, "request timed out"));
     });
 }
 
@@ -82,10 +78,11 @@
 {
   m_validator.validate(data,
     [=] (const Data& data) {
-      this->processValidatedCommandResponse(data, command, onSuccess, onFailure);
+      processValidatedCommandResponse(data, command, onSuccess, onFailure);
     },
-    [=] (const Data& data, const security::v2::ValidationError& error) {
-      onFailure(ControlResponse(ERROR_VALIDATION, boost::lexical_cast<std::string>(error)));
+    [=] (const Data&, const auto& error) {
+      if (onFailure)
+        onFailure(ControlResponse(ERROR_VALIDATION, boost::lexical_cast<std::string>(error)));
     }
   );
 }
@@ -101,13 +98,15 @@
     response.wireDecode(data.getContent().blockFromValue());
   }
   catch (const tlv::Error& e) {
-    onFailure(ControlResponse(ERROR_SERVER, e.what()));
+    if (onFailure)
+      onFailure(ControlResponse(ERROR_SERVER, e.what()));
     return;
   }
 
   uint32_t code = response.getCode();
   if (code >= ERROR_LBOUND) {
-    onFailure(response);
+    if (onFailure)
+      onFailure(response);
     return;
   }
 
@@ -116,7 +115,8 @@
     parameters.wireDecode(response.getBody());
   }
   catch (const tlv::Error& e) {
-    onFailure(ControlResponse(ERROR_SERVER, e.what()));
+    if (onFailure)
+      onFailure(ControlResponse(ERROR_SERVER, e.what()));
     return;
   }
 
@@ -124,11 +124,13 @@
     command->validateResponse(parameters);
   }
   catch (const ControlCommand::ArgumentError& e) {
-    onFailure(ControlResponse(ERROR_SERVER, e.what()));
+    if (onFailure)
+      onFailure(ControlResponse(ERROR_SERVER, e.what()));
     return;
   }
 
-  onSuccess(parameters);
+  if (onSuccess)
+    onSuccess(parameters);
 }
 
 void
@@ -137,21 +139,26 @@
                          const DatasetFailCallback& onFailure,
                          const CommandOptions& options)
 {
-  Interest baseInterest(prefix);
-
   SegmentFetcher::Options fetcherOptions;
   fetcherOptions.maxTimeout = options.getTimeout();
-  auto fetcher = SegmentFetcher::start(m_face, baseInterest, m_validator, fetcherOptions);
-  fetcher->onComplete.connect(processResponse);
-  fetcher->onError.connect([=] (uint32_t code, const std::string& msg) {
+
+  auto fetcher = SegmentFetcher::start(m_face, Interest(prefix), m_validator, fetcherOptions);
+  if (processResponse) {
+    fetcher->onComplete.connect(processResponse);
+  }
+  if (onFailure) {
+    fetcher->onError.connect([=] (uint32_t code, const std::string& msg) {
       processDatasetFetchError(onFailure, code, msg);
     });
+  }
 }
 
 void
 Controller::processDatasetFetchError(const DatasetFailCallback& onFailure,
                                      uint32_t code, std::string msg)
 {
+  BOOST_ASSERT(onFailure);
+
   switch (static_cast<SegmentFetcher::ErrorCode>(code)) {
     // It's intentional to cast as SegmentFetcher::ErrorCode, and to not have a 'default' clause.
     // This forces the switch statement to handle every defined SegmentFetcher::ErrorCode,
diff --git a/src/mgmt/nfd/controller.hpp b/src/mgmt/nfd/controller.hpp
index 8797b39..0553df1 100644
--- a/src/mgmt/nfd/controller.hpp
+++ b/src/mgmt/nfd/controller.hpp
@@ -52,20 +52,21 @@
 public:
   /** \brief a callback on command success
    */
-  typedef function<void(const ControlParameters&)> CommandSucceedCallback;
+  using CommandSucceedCallback = function<void(const ControlParameters&)>;
 
   /** \brief a callback on command failure
    */
-  typedef function<void(const ControlResponse&)> CommandFailCallback;
+  using CommandFailCallback = function<void(const ControlResponse&)>;
 
   /** \brief a callback on dataset retrieval failure
    */
-  typedef function<void(uint32_t code, const std::string& reason)> DatasetFailCallback;
+  using DatasetFailCallback = function<void(uint32_t code, const std::string& reason)>;
 
   /** \brief construct a Controller that uses face for transport,
    *         and uses the passed KeyChain to sign commands
    */
-  Controller(Face& face, KeyChain& keyChain, security::v2::Validator& validator = security::getAcceptAllValidator());
+  Controller(Face& face, KeyChain& keyChain,
+             security::v2::Validator& validator = security::getAcceptAllValidator());
 
   /** \brief start command execution
    */
@@ -76,8 +77,7 @@
         const CommandFailCallback& onFailure,
         const CommandOptions& options = CommandOptions())
   {
-    shared_ptr<ControlCommand> command = make_shared<Command>();
-    this->startCommand(command, parameters, onSuccess, onFailure, options);
+    startCommand(make_shared<Command>(), parameters, onSuccess, onFailure, options);
   }
 
   /** \brief start dataset fetching
@@ -88,7 +88,7 @@
         const DatasetFailCallback& onFailure,
         const CommandOptions& options = CommandOptions())
   {
-    this->fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
+    fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
   }
 
   /** \brief start dataset fetching
@@ -100,7 +100,7 @@
         const DatasetFailCallback& onFailure,
         const CommandOptions& options = CommandOptions())
   {
-    this->fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
+    fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
   }
 
 private:
@@ -175,41 +175,40 @@
 };
 
 template<typename Dataset>
-inline void
+void
 Controller::fetchDataset(shared_ptr<Dataset> dataset,
-                         const std::function<void(typename Dataset::ResultType)>& onSuccess1,
-                         const DatasetFailCallback& onFailure1,
+                         const std::function<void(typename Dataset::ResultType)>& onSuccess,
+                         const DatasetFailCallback& onFailure,
                          const CommandOptions& options)
 {
-  const std::function<void(typename Dataset::ResultType)>& onSuccess = onSuccess1 ?
-    onSuccess1 : [] (const typename Dataset::ResultType&) {};
-  const DatasetFailCallback& onFailure = onFailure1 ?
-    onFailure1 : [] (uint32_t, const std::string&) {};
-
   Name prefix = dataset->getDatasetPrefix(options.getPrefix());
-  this->fetchDataset(prefix,
-                     bind(&Controller::processDatasetResponse<Dataset>, this, dataset, onSuccess, onFailure, _1),
-                     onFailure,
-                     options);
+  fetchDataset(prefix,
+    [=, d = std::move(dataset)] (ConstBufferPtr p) {
+      processDatasetResponse(std::move(d), onSuccess, onFailure, std::move(p));
+    },
+    onFailure, options);
 }
 
 template<typename Dataset>
-inline void
+void
 Controller::processDatasetResponse(shared_ptr<Dataset> dataset,
                                    const std::function<void(typename Dataset::ResultType)>& onSuccess,
                                    const DatasetFailCallback& onFailure,
                                    ConstBufferPtr payload)
 {
   typename Dataset::ResultType result;
+
   try {
-    result = dataset->parseResult(payload);
+    result = dataset->parseResult(std::move(payload));
   }
   catch (const tlv::Error& e) {
-    onFailure(ERROR_SERVER, e.what());
+    if (onFailure)
+      onFailure(ERROR_SERVER, e.what());
     return;
   }
 
-  onSuccess(result);
+  if (onSuccess)
+    onSuccess(result);
 }
 
 } // namespace nfd
diff --git a/src/mgmt/nfd/status-dataset.cpp b/src/mgmt/nfd/status-dataset.cpp
index 5b6d66d..88ce648 100644
--- a/src/mgmt/nfd/status-dataset.cpp
+++ b/src/mgmt/nfd/status-dataset.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -85,7 +85,7 @@
 ForwarderGeneralStatusDataset::ResultType
 ForwarderGeneralStatusDataset::parseResult(ConstBufferPtr payload) const
 {
-  return ForwarderStatus(Block(tlv::Content, payload));
+  return ForwarderStatus(Block(tlv::Content, std::move(payload)));
 }
 
 FaceDatasetBase::FaceDatasetBase(const PartialName& datasetName)
@@ -96,7 +96,7 @@
 FaceDatasetBase::ResultType
 FaceDatasetBase::parseResult(ConstBufferPtr payload) const
 {
-  return parseDatasetVector<FaceStatus>(payload);
+  return parseDatasetVector<FaceStatus>(std::move(payload));
 }
 
 FaceDataset::FaceDataset()
@@ -124,7 +124,7 @@
 ChannelDataset::ResultType
 ChannelDataset::parseResult(ConstBufferPtr payload) const
 {
-  return parseDatasetVector<ChannelStatus>(payload);
+  return parseDatasetVector<ChannelStatus>(std::move(payload));
 }
 
 FibDataset::FibDataset()
@@ -135,7 +135,7 @@
 FibDataset::ResultType
 FibDataset::parseResult(ConstBufferPtr payload) const
 {
-  return parseDatasetVector<FibEntry>(payload);
+  return parseDatasetVector<FibEntry>(std::move(payload));
 }
 
 CsInfoDataset::CsInfoDataset()
@@ -146,7 +146,7 @@
 CsInfoDataset::ResultType
 CsInfoDataset::parseResult(ConstBufferPtr payload) const
 {
-  return CsInfo(Block(payload));
+  return CsInfo(Block(std::move(payload)));
 }
 
 StrategyChoiceDataset::StrategyChoiceDataset()
@@ -157,7 +157,7 @@
 StrategyChoiceDataset::ResultType
 StrategyChoiceDataset::parseResult(ConstBufferPtr payload) const
 {
-  return parseDatasetVector<StrategyChoice>(payload);
+  return parseDatasetVector<StrategyChoice>(std::move(payload));
 }
 
 RibDataset::RibDataset()
@@ -168,7 +168,7 @@
 RibDataset::ResultType
 RibDataset::parseResult(ConstBufferPtr payload) const
 {
-  return parseDatasetVector<RibEntry>(payload);
+  return parseDatasetVector<RibEntry>(std::move(payload));
 }
 
 } // namespace nfd
diff --git a/src/name-component.cpp b/src/name-component.cpp
index cb87c8b..7252d29 100644
--- a/src/name-component.cpp
+++ b/src/name-component.cpp
@@ -343,13 +343,13 @@
 }
 
 Component
-Component::fromImplicitSha256Digest(const ConstBufferPtr& digest)
+Component::fromImplicitSha256Digest(ConstBufferPtr digest)
 {
   if (digest->size() != util::Sha256::DIGEST_SIZE)
     BOOST_THROW_EXCEPTION(Error("Cannot create ImplicitSha256DigestComponent (input digest must be " +
                                 to_string(util::Sha256::DIGEST_SIZE) + " octets)"));
 
-  return Block(tlv::ImplicitSha256DigestComponent, digest);
+  return Block(tlv::ImplicitSha256DigestComponent, std::move(digest));
 }
 
 Component
diff --git a/src/name-component.hpp b/src/name-component.hpp
index 47b6b93..cf39e58 100644
--- a/src/name-component.hpp
+++ b/src/name-component.hpp
@@ -458,7 +458,7 @@
    * @brief Create ImplicitSha256DigestComponent component
    */
   static Component
-  fromImplicitSha256Digest(const ConstBufferPtr& digest);
+  fromImplicitSha256Digest(ConstBufferPtr digest);
 
   /**
    * @brief Create ImplicitSha256DigestComponent component
diff --git a/src/name.hpp b/src/name.hpp
index 0936d3f..2fd48a0 100644
--- a/src/name.hpp
+++ b/src/name.hpp
@@ -432,9 +432,9 @@
    *  @return a reference to this name, to allow chaining
    */
   Name&
-  appendImplicitSha256Digest(const ConstBufferPtr& digest)
+  appendImplicitSha256Digest(ConstBufferPtr digest)
   {
-    return append(Component::fromImplicitSha256Digest(digest));
+    return append(Component::fromImplicitSha256Digest(std::move(digest)));
   }
 
   /** @brief Append an ImplicitSha256Digest component
diff --git a/src/security/pib/identity-container.cpp b/src/security/pib/identity-container.cpp
index 7c018ce..0e4749f 100644
--- a/src/security/pib/identity-container.cpp
+++ b/src/security/pib/identity-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -81,10 +81,10 @@
 }
 
 IdentityContainer::IdentityContainer(shared_ptr<PibImpl> pibImpl)
-  : m_pibImpl(pibImpl)
+  : m_pibImpl(std::move(pibImpl))
 {
-  BOOST_ASSERT(pibImpl != nullptr);
-  m_identityNames = pibImpl->getIdentities();
+  BOOST_ASSERT(m_pibImpl != nullptr);
+  m_identityNames = m_pibImpl->getIdentities();
 }
 
 IdentityContainer::const_iterator
@@ -116,8 +116,7 @@
 {
   if (m_identityNames.count(identityName) == 0) {
     m_identityNames.insert(identityName);
-    m_identities[identityName] =
-      shared_ptr<detail::IdentityImpl>(new detail::IdentityImpl(identityName, m_pibImpl, true));
+    m_identities[identityName] = make_shared<detail::IdentityImpl>(identityName, m_pibImpl, true);
   }
   return get(identityName);
 }
@@ -140,7 +139,7 @@
     id = it->second;
   }
   else {
-    id = shared_ptr<detail::IdentityImpl>(new detail::IdentityImpl(identityName, m_pibImpl, false));
+    id = make_shared<detail::IdentityImpl>(identityName, m_pibImpl, false);
     m_identities[identityName] = id;
   }
   return Identity(id);
diff --git a/src/security/pib/key-container.cpp b/src/security/pib/key-container.cpp
index 7dc8358..ee47e37 100644
--- a/src/security/pib/key-container.cpp
+++ b/src/security/pib/key-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -121,7 +121,7 @@
   }
 
   m_keyNames.insert(keyName);
-  m_keys[keyName] = shared_ptr<detail::KeyImpl>(new detail::KeyImpl(keyName, key, keyLen, m_pib));
+  m_keys[keyName] = make_shared<detail::KeyImpl>(keyName, key, keyLen, m_pib);
 
   return get(keyName);
 }
@@ -154,7 +154,7 @@
     key = it->second;
   }
   else {
-    key = shared_ptr<detail::KeyImpl>(new detail::KeyImpl(keyName, m_pib));
+    key = make_shared<detail::KeyImpl>(keyName, m_pib);
     m_keys[keyName] = key;
   }
 
diff --git a/src/security/pib/pib.cpp b/src/security/pib/pib.cpp
index 68b9add..4fba641 100644
--- a/src/security/pib/pib.cpp
+++ b/src/security/pib/pib.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -34,9 +34,9 @@
   , m_location(location)
   , m_isDefaultIdentityLoaded(false)
   , m_identities(impl)
-  , m_impl(impl)
+  , m_impl(std::move(impl))
 {
-  BOOST_ASSERT(impl != nullptr);
+  BOOST_ASSERT(m_impl != nullptr);
 }
 
 Pib::~Pib() = default;
diff --git a/src/security/pib/pib.hpp b/src/security/pib/pib.hpp
index 947e5a5..27d83da 100644
--- a/src/security/pib/pib.hpp
+++ b/src/security/pib/pib.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -67,7 +67,7 @@
   ~Pib();
 
   /**
-   * @brief return the scheme of the PibLocator
+   * @brief return the scheme of the PIB Locator
    */
   std::string
   getScheme() const
@@ -110,19 +110,21 @@
   Identity
   getIdentity(const Name& identityName) const;
 
-  /// @brief Get all the identities
+  /**
+   * @brief Get all the identities
+   */
   const IdentityContainer&
   getIdentities() const;
 
   /**
    * @brief Get the default identity.
-   * @throw Pib::Error if no default identity.
+   * @throw Pib::Error if no default identity exists.
    */
   const Identity&
   getDefaultIdentity() const;
 
 NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE: // write operations should be private
-  /*
+  /**
    * @brief Create a Pib instance
    *
    * @param scheme The scheme for the Pib
@@ -131,17 +133,8 @@
    */
   Pib(const std::string& scheme, const std::string& location, shared_ptr<PibImpl> impl);
 
-  /*
-   * @brief Create an identity with name @p identityName and return a reference to it.
-   *
-   * If there already exists an identity for the name @p identityName, then it is returned.
-   * If no default identity is set, the newly created identity will be set as the default.
-   *
-   * @param identityName The name for the identity to be added
-   */
-
   /**
-   * @brief Add an @p identity.
+   * @brief Add an identity.
    *
    * If no default identity is set before, the new identity will be set as the default identity
    *
@@ -150,8 +143,8 @@
   Identity
   addIdentity(const Name& identity);
 
-  /*
-   * @brief Remove an @p identity.
+  /**
+   * @brief Remove an identity.
    *
    * If the default identity is being removed, no default identity will be selected.
    */
@@ -159,7 +152,7 @@
   removeIdentity(const Name& identity);
 
   /**
-   * @brief Set an @p identity as the default identity.
+   * @brief Set an identity as the default identity.
    *
    * Create the identity if it does not exist.
    *
diff --git a/src/security/tpm/back-end-file.cpp b/src/security/tpm/back-end-file.cpp
index a560fad..12c1e37 100644
--- a/src/security/tpm/back-end-file.cpp
+++ b/src/security/tpm/back-end-file.cpp
@@ -125,11 +125,11 @@
   setKeyName(*keyHandle, identityName, params);
 
   try {
-    saveKey(keyHandle->getKeyName(), key);
+    saveKey(keyHandle->getKeyName(), *key);
     return keyHandle;
   }
   catch (const std::runtime_error& e) {
-    BOOST_THROW_EXCEPTION(Error("Cannot write key to disk: "s + e.what()));
+    BOOST_THROW_EXCEPTION(Error("Cannot write key to file: "s + e.what()));
   }
 }
 
@@ -137,27 +137,28 @@
 BackEndFile::doDeleteKey(const Name& keyName)
 {
   boost::filesystem::path keyPath(m_impl->toFileName(keyName));
+  if (!boost::filesystem::exists(keyPath))
+    return;
 
-  if (boost::filesystem::exists(keyPath)) {
-    try {
-      boost::filesystem::remove(keyPath);
-    }
-    catch (const boost::filesystem::filesystem_error&) {
-      BOOST_THROW_EXCEPTION(Error("Cannot delete key"));
-    }
+  try {
+    boost::filesystem::remove(keyPath);
+  }
+  catch (const boost::filesystem::filesystem_error& e) {
+    BOOST_THROW_EXCEPTION(Error("Cannot remove key file: "s + e.what()));
   }
 }
 
 ConstBufferPtr
 BackEndFile::doExportKey(const Name& keyName, const char* pw, size_t pwLen)
 {
-  shared_ptr<PrivateKey> key;
+  unique_ptr<PrivateKey> key;
   try {
     key = loadKey(keyName);
   }
-  catch (const PrivateKey::Error&) {
-    BOOST_THROW_EXCEPTION(Error("Cannot export private key"));
+  catch (const PrivateKey::Error& e) {
+    BOOST_THROW_EXCEPTION(Error("Cannot export private key: "s + e.what()));
   }
+
   OBufferStream os;
   key->savePkcs8(os, pw, pwLen);
   return os.buf();
@@ -167,33 +168,33 @@
 BackEndFile::doImportKey(const Name& keyName, const uint8_t* buf, size_t size, const char* pw, size_t pwLen)
 {
   try {
-    auto key = make_shared<PrivateKey>();
-    key->loadPkcs8(buf, size, pw, pwLen);
+    PrivateKey key;
+    key.loadPkcs8(buf, size, pw, pwLen);
     saveKey(keyName, key);
   }
-  catch (const PrivateKey::Error&) {
-    BOOST_THROW_EXCEPTION(Error("Cannot import private key"));
+  catch (const PrivateKey::Error& e) {
+    BOOST_THROW_EXCEPTION(Error("Cannot import private key: "s + e.what()));
   }
 }
 
-shared_ptr<PrivateKey>
+unique_ptr<PrivateKey>
 BackEndFile::loadKey(const Name& keyName) const
 {
-  auto key = make_shared<PrivateKey>();
-  std::fstream is(m_impl->toFileName(keyName).string(), std::ios_base::in);
+  std::ifstream is(m_impl->toFileName(keyName).string());
+  auto key = make_unique<PrivateKey>();
   key->loadPkcs1Base64(is);
   return key;
 }
 
 void
-BackEndFile::saveKey(const Name& keyName, shared_ptr<PrivateKey> key)
+BackEndFile::saveKey(const Name& keyName, const PrivateKey& key)
 {
   std::string fileName = m_impl->toFileName(keyName).string();
-  std::fstream os(fileName, std::ios_base::out);
-  key->savePkcs1Base64(os);
+  std::ofstream os(fileName);
+  key.savePkcs1Base64(os);
 
   // set file permission
-  ::chmod(fileName.c_str(), 0000400);
+  ::chmod(fileName.data(), 0000400);
 }
 
 } // namespace tpm
diff --git a/src/security/tpm/back-end-file.hpp b/src/security/tpm/back-end-file.hpp
index 5609cba..bd2838d 100644
--- a/src/security/tpm/back-end-file.hpp
+++ b/src/security/tpm/back-end-file.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -26,6 +26,7 @@
 
 namespace ndn {
 namespace security {
+
 namespace transform {
 class PrivateKey;
 } // namespace transform
@@ -123,14 +124,14 @@
   /**
    * @brief Load a private key with name @p keyName from the key file directory
    */
-  shared_ptr<transform::PrivateKey>
+  unique_ptr<transform::PrivateKey>
   loadKey(const Name& keyName) const;
 
   /**
    * @brief Save a private key with name @p keyName into the key file directory
    */
   void
-  saveKey(const Name& keyName, shared_ptr<transform::PrivateKey> key);
+  saveKey(const Name& keyName, const transform::PrivateKey& key);
 
 private:
   class Impl;
diff --git a/src/security/tpm/tpm.hpp b/src/security/tpm/tpm.hpp
index 4ce57f2..367a6b9 100644
--- a/src/security/tpm/tpm.hpp
+++ b/src/security/tpm/tpm.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -144,7 +144,7 @@
   unlockTpm(const char* password, size_t passwordLength) const;
 
 NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  /*
+  /**
    * @brief Create a new TPM instance with the specified @p location.
    *
    * @param scheme The scheme for the TPM
diff --git a/src/security/v2/trust-anchor-container.cpp b/src/security/v2/trust-anchor-container.cpp
index 80ef5cc..9137d6f 100644
--- a/src/security/v2/trust-anchor-container.cpp
+++ b/src/security/v2/trust-anchor-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -85,6 +85,7 @@
   auto cert = m_anchors.lower_bound(keyName);
   if (cert == m_anchors.end() || !keyName.isPrefixOf(cert->getName()))
     return nullptr;
+
   return &*cert;
 }
 
@@ -123,7 +124,7 @@
 TrustAnchorContainer::refresh()
 {
   for (auto it = m_groups.begin(); it != m_groups.end(); ++it) {
-    m_groups.modify(it, [] (shared_ptr<TrustAnchorGroup>& group) { group->refresh(); });
+    m_groups.modify(it, [] (const auto& group) { group->refresh(); });
   }
 }
 
diff --git a/src/tag-host.hpp b/src/tag-host.hpp
index 0d1d39d..0d3b914 100644
--- a/src/tag-host.hpp
+++ b/src/tag-host.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -58,12 +58,11 @@
   removeTag() const;
 
 private:
-  mutable std::map<size_t, shared_ptr<Tag>> m_tags;
+  mutable std::map<int, shared_ptr<Tag>> m_tags;
 };
 
-
 template<typename T>
-inline shared_ptr<T>
+shared_ptr<T>
 TagHost::getTag() const
 {
   static_assert(std::is_base_of<Tag, T>::value, "T must inherit from Tag");
@@ -76,21 +75,21 @@
 }
 
 template<typename T>
-inline void
+void
 TagHost::setTag(shared_ptr<T> tag) const
 {
   static_assert(std::is_base_of<Tag, T>::value, "T must inherit from Tag");
 
   if (tag == nullptr) {
     m_tags.erase(T::getTypeId());
-    return;
   }
-
-  m_tags[T::getTypeId()] = tag;
+  else {
+    m_tags[T::getTypeId()] = std::move(tag);
+  }
 }
 
 template<typename T>
-inline void
+void
 TagHost::removeTag() const
 {
   setTag<T>(nullptr);
diff --git a/src/tag.hpp b/src/tag.hpp
index cd36445..1a2db36 100644
--- a/src/tag.hpp
+++ b/src/tag.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -34,13 +34,13 @@
   ~Tag();
 
   /**
-   * @fn static constexpr int getTypeId()
+   * @fn static constexpr int getTypeId() noexcept
    * @return an integer that uniquely identifies this Tag type
-   * @sa http://redmine.named-data.net/projects/ndn-cxx/wiki/PacketTagTypes
+   * @sa https://redmine.named-data.net/projects/ndn-cxx/wiki/PacketTagTypes
    */
 #ifdef DOXYGEN
   static constexpr int
-  getTypeId()
+  getTypeId() noexcept
   {
     return <type-identifier>;
   }
@@ -59,15 +59,15 @@
 {
 public:
   static constexpr int
-  getTypeId()
+  getTypeId() noexcept
   {
     return TypeId;
   }
 
   /** \brief explicitly convertible from T
    */
-  explicit
-  SimpleTag(const T& value)
+  constexpr explicit
+  SimpleTag(const T& value) noexcept
     : m_value(value)
   {
   }
@@ -82,8 +82,8 @@
 
   /** \return the enclosed value
    */
-  const T&
-  get() const
+  constexpr const T&
+  get() const noexcept
   {
     return m_value;
   }
diff --git a/src/util/dummy-client-face.cpp b/src/util/dummy-client-face.cpp
index 9f9383a..657fc02 100644
--- a/src/util/dummy-client-face.cpp
+++ b/src/util/dummy-client-face.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -95,33 +95,30 @@
 {
 }
 
-DummyClientFace::DummyClientFace(const Options& options/* = DummyClientFace::DEFAULT_OPTIONS*/)
+DummyClientFace::DummyClientFace(const Options& options)
   : Face(make_shared<DummyClientFace::Transport>())
-  , m_internalKeyChain(new KeyChain)
+  , m_internalKeyChain(make_unique<KeyChain>())
   , m_keyChain(*m_internalKeyChain)
 {
   this->construct(options);
 }
 
-DummyClientFace::DummyClientFace(KeyChain& keyChain,
-                                 const Options& options/* = DummyClientFace::DEFAULT_OPTIONS*/)
+DummyClientFace::DummyClientFace(KeyChain& keyChain, const Options& options)
   : Face(make_shared<DummyClientFace::Transport>(), keyChain)
   , m_keyChain(keyChain)
 {
   this->construct(options);
 }
 
-DummyClientFace::DummyClientFace(boost::asio::io_service& ioService,
-                                 const Options& options/* = DummyClientFace::DEFAULT_OPTIONS*/)
+DummyClientFace::DummyClientFace(boost::asio::io_service& ioService, const Options& options)
   : Face(make_shared<DummyClientFace::Transport>(), ioService)
-  , m_internalKeyChain(new KeyChain)
+  , m_internalKeyChain(make_unique<KeyChain>())
   , m_keyChain(*m_internalKeyChain)
 {
   this->construct(options);
 }
 
-DummyClientFace::DummyClientFace(boost::asio::io_service& ioService, KeyChain& keyChain,
-                                 const Options& options/* = DummyClientFace::DEFAULT_OPTIONS*/)
+DummyClientFace::DummyClientFace(boost::asio::io_service& ioService, KeyChain& keyChain, const Options& options)
   : Face(make_shared<DummyClientFace::Transport>(), ioService, keyChain)
   , m_keyChain(keyChain)
 {
diff --git a/tests/unit-tests/tag-host.t.cpp b/tests/unit-tests/tag-host.t.cpp
index ae99a8c..432fc74 100644
--- a/tests/unit-tests/tag-host.t.cpp
+++ b/tests/unit-tests/tag-host.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -20,10 +20,10 @@
  */
 
 #include "tag-host.hpp"
+#include "data.hpp"
+#include "interest.hpp"
 
 #include "boost-test.hpp"
-#include "interest.hpp"
-#include "data.hpp"
 
 #include <boost/mpl/vector.hpp>
 
@@ -35,8 +35,8 @@
 class TestTag : public Tag
 {
 public:
-  static constexpr size_t
-  getTypeId()
+  static constexpr int
+  getTypeId() noexcept
   {
     return 1;
   }
@@ -45,8 +45,8 @@
 class TestTag2 : public Tag
 {
 public:
-  static constexpr size_t
-  getTypeId()
+  static constexpr int
+  getTypeId() noexcept
   {
     return 2;
   }
