diff --git a/core/config-file.cpp b/core/config-file.cpp
index 19bf1cb..b9f40b1 100644
--- a/core/config-file.cpp
+++ b/core/config-file.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -59,10 +59,10 @@
 }
 
 bool
-ConfigFile::parseYesNo(const ConfigSection::value_type& option,
+ConfigFile::parseYesNo(const ConfigSection& node, const std::string& key,
                        const std::string& sectionName)
 {
-  auto value = option.second.get_value<std::string>();
+  auto value = node.get_value<std::string>();
 
   if (value == "yes") {
     return true;
@@ -72,7 +72,7 @@
   }
 
   BOOST_THROW_EXCEPTION(Error("Invalid value \"" + value + "\" for option \"" +
-                              option.first + "\" in \"" + sectionName + "\" section"));
+                              key + "\" in \"" + sectionName + "\" section"));
 }
 
 void
@@ -85,14 +85,10 @@
 void
 ConfigFile::parse(const std::string& filename, bool isDryRun)
 {
-  std::ifstream inputFile;
-  inputFile.open(filename.c_str());
-  if (!inputFile.good() || !inputFile.is_open())
-    {
-      std::string msg = "Failed to read configuration file: ";
-      msg += filename;
-      BOOST_THROW_EXCEPTION(Error(msg));
-    }
+  std::ifstream inputFile(filename);
+  if (!inputFile.good() || !inputFile.is_open()) {
+    BOOST_THROW_EXCEPTION(Error("Failed to read configuration file: " + filename));
+  }
   parse(inputFile, isDryRun, filename);
   inputFile.close();
 }
@@ -107,18 +103,16 @@
 void
 ConfigFile::parse(std::istream& input, bool isDryRun, const std::string& filename)
 {
-  try
-    {
-      boost::property_tree::read_info(input, m_global);
-    }
-  catch (const boost::property_tree::info_parser_error& error)
-    {
-      std::stringstream msg;
-      msg << "Failed to parse configuration file";
-      msg << " " << filename;
-      msg << " " << error.message() << " line " << error.line();
-      BOOST_THROW_EXCEPTION(Error(msg.str()));
-    }
+  try {
+    boost::property_tree::read_info(input, m_global);
+  }
+  catch (const boost::property_tree::info_parser_error& error) {
+    std::stringstream msg;
+    msg << "Failed to parse configuration file";
+    msg << " " << filename;
+    msg << " " << error.message() << " line " << error.line();
+    BOOST_THROW_EXCEPTION(Error(msg.str()));
+  }
 
   process(isDryRun, filename);
 }
@@ -144,7 +138,7 @@
 
   for (const auto& i : m_global) {
     try {
-      ConfigSectionHandler subscriber = m_subscriptions.at(i.first);
+      const ConfigSectionHandler& subscriber = m_subscriptions.at(i.first);
       subscriber(i.second, isDryRun, filename);
     }
     catch (const std::out_of_range&) {
@@ -153,4 +147,4 @@
   }
 }
 
-}
+} // namespace nfd
diff --git a/core/config-file.hpp b/core/config-file.hpp
index f6e4aaf..890a22c 100644
--- a/core/config-file.hpp
+++ b/core/config-file.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,6 +45,8 @@
                       const ConfigSection& /*section*/,
                       bool /*isDryRun*/)> UnknownConfigSectionHandler;
 
+/** \brief configuration file parsing utility
+ */
 class ConfigFile : noncopyable
 {
 public:
@@ -61,6 +63,7 @@
   explicit
   ConfigFile(UnknownConfigSectionHandler unknownSectionCallback = throwErrorOnUnknownSection);
 
+public: // unknown section handlers
   static void
   throwErrorOnUnknownSection(const std::string& filename,
                              const std::string& sectionName,
@@ -73,27 +76,50 @@
                        const ConfigSection& section,
                        bool isDryRun);
 
-  /**
-   * \brief parse a config option that can be either "yes" or "no"
-   *
-   * \return true if "yes", false if "no"
-   * \throw Error the value is neither "yes" nor "no"
+public: // parse helpers
+  /** \brief parse a config option that can be either "yes" or "no"
+   *  \retval true "yes"
+   *  \retval false "no"
+   *  \throw Error the value is neither "yes" nor "no"
    */
   static bool
-  parseYesNo(const ConfigSection::value_type& option,
-             const std::string& sectionName);
+  parseYesNo(const ConfigSection& node, const std::string& key, const std::string& sectionName);
+
+  static bool
+  parseYesNo(const ConfigSection::value_type& option, const std::string& sectionName)
+  {
+    return parseYesNo(option.second, option.first, sectionName);
+  }
 
   /**
    * \brief parse a numeric (integral or floating point) config option
+   * \tparam T an arithmetic type
    *
    * \return the numeric value of the parsed option
    * \throw Error the value cannot be converted to the specified type
    */
-  template <typename T>
-  static typename std::enable_if<std::is_arithmetic<T>::value, T>::type
-  parseNumber(const ConfigSection::value_type& option,
-              const std::string& sectionName);
+  template<typename T>
+  static T
+  parseNumber(const ConfigSection& node, const std::string& key, const std::string& sectionName)
+  {
+    static_assert(std::is_arithmetic<T>::value, "T must be an arithmetic type");
 
+    boost::optional<T> value = node.get_value_optional<T>();
+    if (value) {
+      return *value;
+    }
+    BOOST_THROW_EXCEPTION(Error("Invalid value \"" + node.get_value<std::string>() +
+                                "\" for option \"" + key + "\" in \"" + sectionName + "\" section"));
+  }
+
+  template <typename T>
+  static T
+  parseNumber(const ConfigSection::value_type& option, const std::string& sectionName)
+  {
+    return parseNumber<T>(option.second, option.first, sectionName);
+  }
+
+public: // setup and parsing
   /// \brief setup notification of configuration file sections
   void
   addSectionHandler(const std::string& sectionName,
@@ -146,22 +172,6 @@
   ConfigSection m_global;
 };
 
-template <typename T>
-inline typename std::enable_if<std::is_arithmetic<T>::value, T>::type
-ConfigFile::parseNumber(const ConfigSection::value_type& option,
-                        const std::string& sectionName)
-{
-  auto value = option.second.get_value<std::string>();
-
-  try {
-    return boost::lexical_cast<T>(value);
-  }
-  catch (const boost::bad_lexical_cast&) {
-    BOOST_THROW_EXCEPTION(Error("Invalid value \"" + value + "\" for option \"" +
-                                option.first + "\" in \"" + sectionName + "\" section"));
-  }
-}
-
 } // namespace nfd
 
 #endif // NFD_CORE_CONFIG_FILE_HPP
