diff --git a/src/security/v2/validator-config/checker.cpp b/src/security/v2/validator-config/checker.cpp
index dc4d49a..908e126 100644
--- a/src/security/v2/validator-config/checker.cpp
+++ b/src/security/v2/validator-config/checker.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).
  *
@@ -23,11 +23,8 @@
 #include "security/v2/validation-state.hpp"
 #include "security/verification-helpers.hpp"
 #include "security/pib/key.hpp"
-#include "util/logger.hpp"
 
-#include <boost/algorithm/string.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string/predicate.hpp>
 
 namespace ndn {
 namespace security {
@@ -35,7 +32,8 @@
 namespace validator_config {
 
 bool
-Checker::check(uint32_t pktType, const Name& pktName, const Name& klName, const shared_ptr<ValidationState>& state)
+Checker::check(uint32_t pktType, const Name& pktName, const Name& klName,
+               const shared_ptr<ValidationState>& state)
 {
   BOOST_ASSERT(pktType == tlv::Interest || pktType == tlv::Data);
 
@@ -57,7 +55,8 @@
 }
 
 bool
-NameRelationChecker::checkNames(const Name& pktName, const Name& klName, const shared_ptr<ValidationState>& state)
+NameRelationChecker::checkNames(const Name& pktName, const Name& klName,
+                                const shared_ptr<ValidationState>& state)
 {
   // pktName not used in this check
   Name identity = extractIdentityFromKeyName(klName);
@@ -87,7 +86,6 @@
        << " (KeyLocator=" << klName << ")";
     state->fail({ValidationError::POLICY_ERROR, os.str()});
   }
-
   return result;
 }
 
@@ -101,7 +99,8 @@
 }
 
 bool
-HyperRelationChecker::checkNames(const Name& pktName, const Name& klName, const shared_ptr<ValidationState>& state)
+HyperRelationChecker::checkNames(const Name& pktName, const Name& klName,
+                                 const shared_ptr<ValidationState>& state)
 {
   if (!m_hyperPRegex.match(pktName) || !m_hyperKRegex.match(klName)) {
     std::ostringstream os;
@@ -129,11 +128,10 @@
 
   // Get checker.type
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type")) {
-    BOOST_THROW_EXCEPTION(Error("Expect <checker.type>"));
+    BOOST_THROW_EXCEPTION(Error("Expecting <checker.type>"));
   }
 
   std::string type = propertyIt->second.data();
-
   if (boost::iequals(type, "customized")) {
     return createCustomizedChecker(configSection, configFilename);
   }
@@ -141,13 +139,13 @@
     return createHierarchicalChecker(configSection, configFilename);
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unsupported checker type: " + type));
+    BOOST_THROW_EXCEPTION(Error("Unrecognized <checker.type>: " + type));
   }
 }
 
 unique_ptr<Checker>
 Checker::createCustomizedChecker(const ConfigSection& configSection,
-                                        const std::string& configFilename)
+                                 const std::string& configFilename)
 {
   auto propertyIt = configSection.begin();
   propertyIt++;
@@ -161,22 +159,21 @@
 
   // Get checker.key-locator
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "key-locator")) {
-    BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator>"));
+    BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator>"));
   }
 
   auto checker = createKeyLocatorChecker(propertyIt->second, configFilename);
   propertyIt++;
 
   if (propertyIt != configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Expect the end of checker"));
+    BOOST_THROW_EXCEPTION(Error("Expecting end of <checker>"));
   }
-
   return checker;
 }
 
 unique_ptr<Checker>
 Checker::createHierarchicalChecker(const ConfigSection& configSection,
-                                          const std::string& configFilename)
+                                   const std::string& configFilename)
 {
   auto propertyIt = configSection.begin();
   propertyIt++;
@@ -189,54 +186,52 @@
   }
 
   if (propertyIt != configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Expect the end of checker"));
+    BOOST_THROW_EXCEPTION(Error("Expecting end of <checker>"));
   }
-
   return make_unique<HyperRelationChecker>("^(<>*)$",        "\\1",
                                            "^(<>*)<KEY><>$", "\\1",
                                            NameRelation::IS_PREFIX_OF);
 }
 
-///
-
 unique_ptr<Checker>
-Checker::createKeyLocatorChecker(const ConfigSection& configSection, const std::string& configFilename)
+Checker::createKeyLocatorChecker(const ConfigSection& configSection,
+                                 const std::string& configFilename)
 {
   auto propertyIt = configSection.begin();
 
   // Get checker.key-locator.type
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type"))
-    BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator.type>"));
+    BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.type>"));
 
   std::string type = propertyIt->second.data();
-
   if (boost::iequals(type, "name"))
     return createKeyLocatorNameChecker(configSection, configFilename);
   else
-    BOOST_THROW_EXCEPTION(Error("Unsupported checker.key-locator.type: " + type));
+    BOOST_THROW_EXCEPTION(Error("Unrecognized <checker.key-locator.type>: " + type));
 }
 
 unique_ptr<Checker>
-Checker::createKeyLocatorNameChecker(const ConfigSection& configSection, const std::string& configFilename)
+Checker::createKeyLocatorNameChecker(const ConfigSection& configSection,
+                                     const std::string& configFilename)
 {
   auto propertyIt = configSection.begin();
   propertyIt++;
 
   if (propertyIt == configSection.end())
-    BOOST_THROW_EXCEPTION(Error("Expect more checker.key-locator properties"));
+    BOOST_THROW_EXCEPTION(Error("Unexpected end of <checker.key-locator>"));
 
   if (boost::iequals(propertyIt->first, "name")) {
     Name name;
     try {
       name = Name(propertyIt->second.data());
     }
-    catch (const Name::Error& e) {
-      BOOST_THROW_EXCEPTION(Error("Invalid checker.key-locator.name: " + propertyIt->second.data()));
+    catch (const Name::Error&) {
+      BOOST_THROW_EXCEPTION(Error("Invalid <checker.key-locator.name>: " + propertyIt->second.data()));
     }
     propertyIt++;
 
     if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "relation")) {
-      BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator.relation>"));
+      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.relation>"));
     }
 
     std::string relationString = propertyIt->second.data();
@@ -245,7 +240,7 @@
     NameRelation relation = getNameRelationFromString(relationString);
 
     if (propertyIt != configSection.end()) {
-      BOOST_THROW_EXCEPTION(Error("Expect the end of checker.key-locator"));
+      BOOST_THROW_EXCEPTION(Error("Expecting end of <checker.key-locator>"));
     }
     return make_unique<NameRelationChecker>(name, relation);
   }
@@ -254,24 +249,23 @@
     propertyIt++;
 
     if (propertyIt != configSection.end()) {
-      BOOST_THROW_EXCEPTION(Error("Expect the end of checker.key-locator"));
+      BOOST_THROW_EXCEPTION(Error("Expecting end of <checker.key-locator>"));
     }
 
     try {
       return make_unique<RegexChecker>(Regex(regexString));
     }
-    catch (const Regex::Error& e) {
-      BOOST_THROW_EXCEPTION(Error("Invalid checker.key-locator.regex: " + regexString));
+    catch (const Regex::Error&) {
+      BOOST_THROW_EXCEPTION(Error("Invalid <checker.key-locator.regex>: " + regexString));
     }
   }
   else if (boost::iequals(propertyIt->first, "hyper-relation")) {
     const ConfigSection& hSection = propertyIt->second;
-
     ConfigSection::const_iterator hPropertyIt = hSection.begin();
 
     // Get k-regex
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "k-regex")) {
-      BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator.hyper-relation.k-regex>"));
+      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.k-regex>"));
     }
 
     std::string kRegex = hPropertyIt->second.data();
@@ -279,7 +273,7 @@
 
     // Get k-expand
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "k-expand")) {
-      BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator.hyper-relation.k-expand>"));
+      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.k-expand>"));
     }
 
     std::string kExpand = hPropertyIt->second.data();
@@ -287,7 +281,7 @@
 
     // Get h-relation
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "h-relation")) {
-      BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator.hyper-relation.h-relation>"));
+      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.h-relation>"));
     }
 
     std::string hRelation = hPropertyIt->second.data();
@@ -295,7 +289,7 @@
 
     // Get p-regex
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "p-regex")) {
-      BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator.hyper-relation.p-regex>"));
+      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.p-regex>"));
     }
 
     std::string pRegex = hPropertyIt->second.data();
@@ -303,26 +297,26 @@
 
     // Get p-expand
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "p-expand")) {
-      BOOST_THROW_EXCEPTION(Error("Expect <checker.key-locator.hyper-relation.p-expand>"));
+      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.p-expand>"));
     }
 
     std::string pExpand = hPropertyIt->second.data();
     hPropertyIt++;
 
     if (hPropertyIt != hSection.end()) {
-      BOOST_THROW_EXCEPTION(Error("Expect the end of checker.key-locator.hyper-relation"));
+      BOOST_THROW_EXCEPTION(Error("Expecting end of <checker.key-locator.hyper-relation>"));
     }
 
     NameRelation relation = getNameRelationFromString(hRelation);
     try {
       return make_unique<HyperRelationChecker>(pRegex, pExpand, kRegex, kExpand, relation);
     }
-    catch (const Regex::Error& e) {
-      BOOST_THROW_EXCEPTION(Error("Invalid regex for key-locator.hyper-relation"));
+    catch (const Regex::Error&) {
+      BOOST_THROW_EXCEPTION(Error("Invalid regex for <key-locator.hyper-relation>"));
     }
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unsupported checker.key-locator"));
+    BOOST_THROW_EXCEPTION(Error("Unrecognized <checker.key-locator>: " + propertyIt->first));
   }
 }
 
diff --git a/src/security/v2/validator-config/filter.cpp b/src/security/v2/validator-config/filter.cpp
index 1379c98..d9032c8 100644
--- a/src/security/v2/validator-config/filter.cpp
+++ b/src/security/v2/validator-config/filter.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).
  *
@@ -23,10 +23,10 @@
 
 #include "data.hpp"
 #include "interest.hpp"
-#include "util/regex.hpp"
 #include "security/security-common.hpp"
+#include "util/regex.hpp"
 
-#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/predicate.hpp>
 
 namespace ndn {
 namespace security {
@@ -78,15 +78,14 @@
   auto propertyIt = configSection.begin();
 
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type")) {
-    BOOST_THROW_EXCEPTION(Error("Expect <filter.type>"));
+    BOOST_THROW_EXCEPTION(Error("Expecting <filter.type>"));
   }
 
   std::string type = propertyIt->second.data();
-
   if (boost::iequals(type, "name"))
     return createNameFilter(configSection, configFilename);
   else
-    BOOST_THROW_EXCEPTION(Error("Unsupported filter.type: " + type));
+    BOOST_THROW_EXCEPTION(Error("Unrecognized <filter.type>: " + type));
 }
 
 unique_ptr<Filter>
@@ -95,9 +94,8 @@
   auto propertyIt = configSection.begin();
   propertyIt++;
 
-  if (propertyIt == configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Expect more properties for filter(name)"));
-  }
+  if (propertyIt == configSection.end())
+    BOOST_THROW_EXCEPTION(Error("Unexpected end of <filter>"));
 
   if (boost::iequals(propertyIt->first, "name")) {
     // Get filter.name
@@ -105,22 +103,22 @@
     try {
       name = Name(propertyIt->second.data());
     }
-    catch (const Name::Error& e) {
-      BOOST_THROW_EXCEPTION(Error("Wrong filter.name: " + propertyIt->second.data()));
+    catch (const Name::Error&) {
+      BOOST_THROW_EXCEPTION(Error("Invalid <filter.name>: " + propertyIt->second.data()));
     }
 
     propertyIt++;
 
     // Get filter.relation
     if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "relation")) {
-      BOOST_THROW_EXCEPTION(Error("Expect <filter.relation>"));
+      BOOST_THROW_EXCEPTION(Error("Expecting <filter.relation>"));
     }
 
     NameRelation relation = getNameRelationFromString(propertyIt->second.data());
     propertyIt++;
 
     if (propertyIt != configSection.end())
-      BOOST_THROW_EXCEPTION(Error("Expect the end of filter"));
+      BOOST_THROW_EXCEPTION(Error("Expecting end of <filter>"));
 
     return make_unique<RelationNameFilter>(name, relation);
   }
@@ -129,17 +127,17 @@
     propertyIt++;
 
     if (propertyIt != configSection.end())
-      BOOST_THROW_EXCEPTION(Error("Expect the end of filter"));
+      BOOST_THROW_EXCEPTION(Error("Expecting end of <filter>"));
 
     try {
       return make_unique<RegexNameFilter>(Regex(regexString));
     }
-    catch (const Regex::Error& e) {
-      BOOST_THROW_EXCEPTION(Error("Wrong filter.regex: " + regexString));
+    catch (const Regex::Error&) {
+      BOOST_THROW_EXCEPTION(Error("Invalid <filter.regex>: " + regexString));
     }
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Wrong filter(name) properties"));
+    BOOST_THROW_EXCEPTION(Error("Unrecognized <filter> property: " + propertyIt->first));
   }
 }
 
diff --git a/src/security/v2/validator-config/rule.cpp b/src/security/v2/validator-config/rule.cpp
index 93b8df4..2cc3124 100644
--- a/src/security/v2/validator-config/rule.cpp
+++ b/src/security/v2/validator-config/rule.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).
  *
@@ -73,7 +73,8 @@
 }
 
 bool
-Rule::check(uint32_t pktType, const Name& pktName, const Name& klName, const shared_ptr<ValidationState>& state) const
+Rule::check(uint32_t pktType, const Name& pktName, const Name& klName,
+            const shared_ptr<ValidationState>& state) const
 {
   NDN_LOG_TRACE("Trying to check " << pktName << " with keyLocator " << klName);
 
@@ -151,9 +152,8 @@
     hasCheckers = true;
   }
 
-  // Check other stuff
   if (propertyIt != configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Expecting the end of rule: " + ruleId));
+    BOOST_THROW_EXCEPTION(Error("Expecting end of <rule>: " + ruleId));
   }
 
   if (!hasCheckers) {
