diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 90e99af..5f8eef0 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -34,7 +34,6 @@
 #include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/encoding/tlv-nfd.hpp>
 #include <ndn-cxx/mgmt/nfd/channel-status.hpp>
-#include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
 #include <ndn-cxx/net/network-monitor-stub.hpp>
 
 namespace nfd {
@@ -57,14 +56,14 @@
     REMOVE_LAST_NOTIFICATION = 1 << 0,
     SET_SCOPE_LOCAL          = 1 << 1,
     SET_URI_TEST             = 1 << 2,
-    RANDOMIZE_COUNTERS       = 1 << 3
+    RANDOMIZE_COUNTERS       = 1 << 3,
   };
 
   /** \brief adds a face to the FaceTable
    *  \param options bitwise OR'ed AddFaceFlags
    */
   shared_ptr<Face>
-  addFace(int flags = 0)
+  addFace(unsigned int flags = 0)
   {
     std::string uri = "dummy://";
     ndn::nfd::FaceScope scope = ndn::nfd::FACE_SCOPE_NON_LOCAL;
@@ -103,7 +102,7 @@
 
 private:
   template<typename T>
-  static typename std::enable_if<std::is_base_of<SimpleCounter, T>::value>::type
+  static void
   randomizeCounter(const T& counter)
   {
     static std::uniform_int_distribution<typename T::rep> dist;
@@ -155,24 +154,20 @@
 
 BOOST_AUTO_TEST_CASE(FaceDataset)
 {
-  size_t nEntries = 303;
+  const size_t nEntries = 303;
   for (size_t i = 0; i < nEntries; ++i) {
     addFace(REMOVE_LAST_NOTIFICATION | SET_URI_TEST | RANDOMIZE_COUNTERS);
   }
 
   receiveInterest(Interest("/localhost/nfd/faces/list"));
 
-  Block content;
-  BOOST_CHECK_NO_THROW(content = concatenateResponses());
-  BOOST_CHECK_NO_THROW(content.parse());
+  Block content = concatenateResponses();
+  content.parse();
   BOOST_REQUIRE_EQUAL(content.elements().size(), nEntries);
 
   std::set<FaceId> faceIds;
   for (size_t idx = 0; idx < nEntries; ++idx) {
-    BOOST_TEST_MESSAGE("processing element: " << idx);
-
-    ndn::nfd::FaceStatus decodedStatus;
-    BOOST_REQUIRE_NO_THROW(decodedStatus.wireDecode(content.elements()[idx]));
+    ndn::nfd::FaceStatus decodedStatus(content.elements()[idx]);
     BOOST_CHECK(m_faceTable.get(decodedStatus.getFaceId()) != nullptr);
     faceIds.insert(decodedStatus.getFaceId());
   }
@@ -183,22 +178,21 @@
 
 BOOST_AUTO_TEST_CASE(FaceQuery)
 {
+  using ndn::nfd::FaceQueryFilter;
+
   auto face1 = addFace(REMOVE_LAST_NOTIFICATION); // dummy://
   auto face2 = addFace(REMOVE_LAST_NOTIFICATION | SET_SCOPE_LOCAL); // dummy://, local
   auto face3 = addFace(REMOVE_LAST_NOTIFICATION | SET_URI_TEST); // test://
 
-  auto generateQueryName = [] (const ndn::nfd::FaceQueryFilter& filter) {
+  auto generateQueryName = [] (const FaceQueryFilter& filter) {
     return Name("/localhost/nfd/faces/query").append(filter.wireEncode());
   };
 
-  auto querySchemeName =
-    generateQueryName(ndn::nfd::FaceQueryFilter().setUriScheme("dummy"));
-  auto queryIdName =
-    generateQueryName(ndn::nfd::FaceQueryFilter().setFaceId(face1->getId()));
-  auto queryScopeName =
-    generateQueryName(ndn::nfd::FaceQueryFilter().setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL));
-  auto invalidQueryName =
-    Name("/localhost/nfd/faces/query").append(ndn::makeStringBlock(tlv::Content, "invalid"));
+  auto querySchemeName = generateQueryName(FaceQueryFilter().setUriScheme("dummy"));
+  auto queryIdName = generateQueryName(FaceQueryFilter().setFaceId(face1->getId()));
+  auto queryScopeName = generateQueryName(FaceQueryFilter().setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL));
+  auto invalidQueryName = Name("/localhost/nfd/faces/query")
+                          .append(ndn::makeStringBlock(tlv::Content, "invalid"));
 
   receiveInterest(Interest(querySchemeName)); // face1 and face2 expected
   receiveInterest(Interest(queryIdName)); // face1 expected
@@ -211,25 +205,25 @@
   ndn::nfd::FaceStatus status;
 
   content = m_responses[0].getContent();
-  BOOST_CHECK_NO_THROW(content.parse());
+  content.parse();
   BOOST_CHECK_EQUAL(content.elements().size(), 2); // face1 and face2
-  BOOST_CHECK_NO_THROW(status.wireDecode(content.elements()[0]));
+  status.wireDecode(content.elements()[0]);
   BOOST_CHECK_EQUAL(face1->getId(), status.getFaceId());
-  BOOST_CHECK_NO_THROW(status.wireDecode(content.elements()[1]));
+  status.wireDecode(content.elements()[1]);
   BOOST_CHECK_EQUAL(face2->getId(), status.getFaceId());
 
   content = m_responses[1].getContent();
-  BOOST_CHECK_NO_THROW(content.parse());
+  content.parse();
   BOOST_CHECK_EQUAL(content.elements().size(), 1); // face1
-  BOOST_CHECK_NO_THROW(status.wireDecode(content.elements()[0]));
+  status.wireDecode(content.elements()[0]);
   BOOST_CHECK_EQUAL(face1->getId(), status.getFaceId());
 
   content = m_responses[2].getContent();
-  BOOST_CHECK_NO_THROW(content.parse());
+  content.parse();
   BOOST_CHECK_EQUAL(content.elements().size(), 2); // face1 and face3
-  BOOST_CHECK_NO_THROW(status.wireDecode(content.elements()[0]));
+  status.wireDecode(content.elements()[0]);
   BOOST_CHECK_EQUAL(face1->getId(), status.getFaceId());
-  BOOST_CHECK_NO_THROW(status.wireDecode(content.elements()[1]));
+  status.wireDecode(content.elements()[1]);
   BOOST_CHECK_EQUAL(face3->getId(), status.getFaceId());
 
   ControlResponse expectedResponse(400, "Malformed filter"); // nack, 400, malformed filter
@@ -308,25 +302,21 @@
     make_unique<TestProtocolFactory>(m_faceSystem.makePFCtorParams());
   auto factory = static_cast<TestProtocolFactory*>(m_manager.m_faceSystem.getFactoryById("test"));
 
+  const size_t nEntries = 404;
   std::map<std::string, shared_ptr<TestChannel>> addedChannels;
-  size_t nEntries = 404;
   for (size_t i = 0; i < nEntries; i++) {
-    auto channel = factory->addChannel("test" + boost::lexical_cast<std::string>(i) + "://");
+    auto channel = factory->addChannel("test" + to_string(i) + "://");
     addedChannels[channel->getUri().toString()] = channel;
   }
 
   receiveInterest(Interest("/localhost/nfd/faces/channels"));
 
-  Block content;
-  BOOST_CHECK_NO_THROW(content = concatenateResponses());
-  BOOST_CHECK_NO_THROW(content.parse());
+  Block content = concatenateResponses();
+  content.parse();
   BOOST_REQUIRE_EQUAL(content.elements().size(), nEntries);
 
   for (size_t idx = 0; idx < nEntries; ++idx) {
-    BOOST_TEST_MESSAGE("processing element: " << idx);
-
-    ndn::nfd::ChannelStatus decodedStatus;
-    BOOST_CHECK_NO_THROW(decodedStatus.wireDecode(content.elements()[idx]));
+    ndn::nfd::ChannelStatus decodedStatus(content.elements()[idx]);
     BOOST_CHECK(addedChannels.find(decodedStatus.getLocalUri()) != addedChannels.end());
   }
 }
@@ -344,12 +334,10 @@
   BOOST_CHECK_EQUAL(m_manager.m_faceStateChangeConn.count(faceId), 1);
 
   // check notification
-  Block payload;
-  ndn::nfd::FaceEventNotification notification;
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
-  BOOST_CHECK_NO_THROW(payload = m_responses.back().getContent().blockFromValue());
+  Block payload = m_responses.back().getContent().blockFromValue();
   BOOST_CHECK_EQUAL(payload.type(), ndn::tlv::nfd::FaceEventNotification);
-  BOOST_CHECK_NO_THROW(notification.wireDecode(payload));
+  ndn::nfd::FaceEventNotification notification(payload);
   BOOST_CHECK_EQUAL(notification.getKind(), ndn::nfd::FACE_EVENT_CREATED);
   BOOST_CHECK_EQUAL(notification.getFaceId(), faceId);
   BOOST_CHECK_EQUAL(notification.getRemoteUri(), face->getRemoteUri().toString());
@@ -357,7 +345,7 @@
   BOOST_CHECK_EQUAL(notification.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
   BOOST_CHECK_EQUAL(notification.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
   BOOST_CHECK_EQUAL(notification.getLinkType(), ndn::nfd::LinkType::LINK_TYPE_POINT_TO_POINT);
-  BOOST_CHECK_EQUAL(notification.getFlags(), 0x0);
+  BOOST_CHECK_EQUAL(notification.getFlags(), 0);
 }
 
 BOOST_AUTO_TEST_CASE(FaceEventDownUp)
@@ -373,12 +361,10 @@
 
   // check notification
   {
-    Block payload;
-    ndn::nfd::FaceEventNotification notification;
     BOOST_REQUIRE_EQUAL(m_responses.size(), 2);
-    BOOST_CHECK_NO_THROW(payload = m_responses.back().getContent().blockFromValue());
+    Block payload = m_responses.back().getContent().blockFromValue();
     BOOST_CHECK_EQUAL(payload.type(), ndn::tlv::nfd::FaceEventNotification);
-    BOOST_CHECK_NO_THROW(notification.wireDecode(payload));
+    ndn::nfd::FaceEventNotification notification(payload);
     BOOST_CHECK_EQUAL(notification.getKind(), ndn::nfd::FACE_EVENT_DOWN);
     BOOST_CHECK_EQUAL(notification.getFaceId(), faceId);
     BOOST_CHECK_EQUAL(notification.getRemoteUri(), face->getRemoteUri().toString());
@@ -386,7 +372,7 @@
     BOOST_CHECK_EQUAL(notification.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
     BOOST_CHECK_EQUAL(notification.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
     BOOST_CHECK_EQUAL(notification.getLinkType(), ndn::nfd::LinkType::LINK_TYPE_POINT_TO_POINT);
-    BOOST_CHECK_EQUAL(notification.getFlags(), 0x0);
+    BOOST_CHECK_EQUAL(notification.getFlags(), 0);
   }
 
   // trigger FACE_EVENT_UP notification
@@ -396,12 +382,10 @@
 
   // check notification
   {
-    Block payload;
-    ndn::nfd::FaceEventNotification notification;
     BOOST_REQUIRE_EQUAL(m_responses.size(), 3);
-    BOOST_CHECK_NO_THROW(payload = m_responses.back().getContent().blockFromValue());
+    Block payload = m_responses.back().getContent().blockFromValue();
     BOOST_CHECK_EQUAL(payload.type(), ndn::tlv::nfd::FaceEventNotification);
-    BOOST_CHECK_NO_THROW(notification.wireDecode(payload));
+    ndn::nfd::FaceEventNotification notification(payload);
     BOOST_CHECK_EQUAL(notification.getKind(), ndn::nfd::FACE_EVENT_UP);
     BOOST_CHECK_EQUAL(notification.getFaceId(), faceId);
     BOOST_CHECK_EQUAL(notification.getRemoteUri(), face->getRemoteUri().toString());
@@ -409,7 +393,7 @@
     BOOST_CHECK_EQUAL(notification.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
     BOOST_CHECK_EQUAL(notification.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
     BOOST_CHECK_EQUAL(notification.getLinkType(), ndn::nfd::LinkType::LINK_TYPE_POINT_TO_POINT);
-    BOOST_CHECK_EQUAL(notification.getFlags(), 0x0);
+    BOOST_CHECK_EQUAL(notification.getFlags(), 0);
   }
 }
 
@@ -425,12 +409,10 @@
   advanceClocks(time::milliseconds(1), 10);
 
   // check notification
-  Block payload;
-  ndn::nfd::FaceEventNotification notification;
   BOOST_REQUIRE_EQUAL(m_responses.size(), 2);
-  BOOST_CHECK_NO_THROW(payload = m_responses.back().getContent().blockFromValue());
+  Block payload = m_responses.back().getContent().blockFromValue();
   BOOST_CHECK_EQUAL(payload.type(), ndn::tlv::nfd::FaceEventNotification);
-  BOOST_CHECK_NO_THROW(notification.wireDecode(payload));
+  ndn::nfd::FaceEventNotification notification(payload);
   BOOST_CHECK_EQUAL(notification.getKind(), ndn::nfd::FACE_EVENT_DESTROYED);
   BOOST_CHECK_EQUAL(notification.getFaceId(), faceId);
   BOOST_CHECK_EQUAL(notification.getRemoteUri(), face->getRemoteUri().toString());
@@ -438,7 +420,7 @@
   BOOST_CHECK_EQUAL(notification.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
   BOOST_CHECK_EQUAL(notification.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
   BOOST_CHECK_EQUAL(notification.getLinkType(), ndn::nfd::LinkType::LINK_TYPE_POINT_TO_POINT);
-  BOOST_CHECK_EQUAL(notification.getFlags(), 0x0);
+  BOOST_CHECK_EQUAL(notification.getFlags(), 0);
 
   BOOST_CHECK_EQUAL(face->getId(), face::INVALID_FACEID);
   BOOST_CHECK_EQUAL(m_manager.m_faceStateChangeConn.count(faceId), 0);
