diff --git a/src/storage/index.hpp b/src/storage/index.hpp
index 51d51b2..d60bd37 100644
--- a/src/storage/index.hpp
+++ b/src/storage/index.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014,  Regents of the University of California.
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -20,7 +20,8 @@
 #ifndef REPO_STORAGE_INDEX_HPP
 #define REPO_STORAGE_INDEX_HPP
 
-#include "common.hpp"
+#include "../common.hpp"
+
 #include <set>
 
 namespace repo {
@@ -52,13 +53,10 @@
     };
 
   public:
-
     /**
      * @brief used by set to construct node
      */
-    Entry()
-    {
-    };
+    Entry() = default;
 
     /**
      * @brief construct Entry by data and id number
@@ -143,7 +141,6 @@
   };
 
 private:
-
   typedef std::set<Entry> IndexContainer;
 
 public:
diff --git a/src/storage/storage.hpp b/src/storage/storage.hpp
index bf75306..e1cb537 100755
--- a/src/storage/storage.hpp
+++ b/src/storage/storage.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014,  Regents of the University of California.
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -19,9 +19,7 @@
 
 #ifndef REPO_STORAGE_STORAGE_HPP
 #define REPO_STORAGE_STORAGE_HPP
-#include <string>
-#include <iostream>
-#include <stdlib.h>
+
 #include "../common.hpp"
 
 namespace repo {
@@ -42,7 +40,6 @@
     }
   };
 
-public:
   class ItemMeta
   {
   public:
@@ -51,12 +48,9 @@
     ndn::ConstBufferPtr keyLocatorHash;
   };
 
-public :
-
+public:
   virtual
-  ~Storage()
-  {
-  };
+  ~Storage() = default;
 
   /**
    *  @brief  put the data into database
@@ -91,9 +85,8 @@
    */
   virtual void
   fullEnumerate(const std::function<void(const Storage::ItemMeta)>& f) = 0;
-
 };
 
 } // namespace repo
 
-#endif // REPO_STORAGE_Storage_HPP
+#endif // REPO_STORAGE_STORAGE_HPP
diff --git a/tools/ndngetfile.cpp b/tools/ndngetfile.cpp
index 125eab0..dbc5b5d 100644
--- a/tools/ndngetfile.cpp
+++ b/tools/ndngetfile.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -42,22 +42,17 @@
 {
   Interest interest(name);
   interest.setInterestLifetime(m_interestLifetime);
-  //std::cout<<"interest name = "<<interest.getName()<<std::endl;
-  if (m_hasVersion)
-    {
-      interest.setMustBeFresh(m_mustBeFresh);
-    }
-  else
-    {
-      interest.setMustBeFresh(true);
-      interest.setChildSelector(1);
-    }
+  if (m_hasVersion) {
+    interest.setMustBeFresh(m_mustBeFresh);
+  }
+  else {
+    interest.setMustBeFresh(true);
+    interest.setChildSelector(1);
+  }
 
   m_face.expressInterest(interest,
-                         m_hasVersion ?
-                         bind(&Consumer::onVersionedData, this, _1, _2)
-                         :
-                         bind(&Consumer::onUnversionedData, this, _1, _2),
+                         m_hasVersion ? bind(&Consumer::onVersionedData, this, _1, _2)
+                                      : bind(&Consumer::onUnversionedData, this, _1, _2),
                          bind(&Consumer::onTimeout, this, _1), // Nack
                          bind(&Consumer::onTimeout, this, _1));
 }
@@ -156,8 +151,7 @@
   const Block& content = data.getContent();
   m_os.write(reinterpret_cast<const char*>(content.value()), content.value_size());
   m_totalSize += content.value_size();
-  if (m_verbose)
-  {
+  if (m_verbose) {
     std::cerr << "LOG: received data = " << data.getName() << std::endl;
   }
   if (m_isFinished || m_isSingle) {
@@ -171,13 +165,13 @@
 Consumer::fetchNextData(const Name& name, const Data& data)
 {
   uint64_t segment = name[-1].toSegment();
-  BOOST_ASSERT(segment == (m_nextSegment - 1));
+  BOOST_VERIFY(segment == (m_nextSegment - 1));
+
   const ndn::name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
   if (finalBlockId == name[-1]) {
     m_isFinished = true;
   }
-  else
-  {
+  else {
     // Reset retry counter
     m_retryCount = 0;
     if (m_hasVersion)
@@ -190,24 +184,19 @@
 void
 Consumer::onTimeout(const Interest& interest)
 {
-  if (m_retryCount++ < MAX_RETRY)
-    {
-      // Retransmit the interest
-      fetchData(interest.getName());
-      if (m_verbose)
-        {
-          std::cerr << "TIMEOUT: retransmit interest for " << interest.getName() << std::endl;
-        }
-    }
-  else
-    {
-      std::cerr << "TIMEOUT: last interest sent for segment #" << (m_nextSegment - 1) << std::endl;
-      std::cerr << "TIMEOUT: abort fetching after " << MAX_RETRY
-                << " times of retry" << std::endl;
-    }
+  if (m_retryCount++ < MAX_RETRY) {
+    // Retransmit the interest
+    fetchData(interest.getName());
+    if (m_verbose)
+      std::cerr << "TIMEOUT: retransmit interest for " << interest.getName() << std::endl;
+  }
+  else {
+    std::cerr << "TIMEOUT: last interest sent for segment #" << (m_nextSegment - 1) << std::endl;
+    std::cerr << "TIMEOUT: abort fetching after " << MAX_RETRY
+              << " times of retry" << std::endl;
+  }
 }
 
-
 int
 usage(const std::string& filename)
 {
@@ -224,101 +213,85 @@
   return 1;
 }
 
-
 int
 main(int argc, char** argv)
 {
   std::string name;
-  const char* outputFile = 0;
+  const char* outputFile = nullptr;
   bool verbose = false, versioned = false, single = false;
   int interestLifetime = 4000;  // in milliseconds
   int timeout = 0;  // in milliseconds
 
   int opt;
-  while ((opt = getopt(argc, argv, "vsul:w:o:")) != -1)
-    {
-      switch (opt) {
-      case 'v':
-        verbose = true;
-        break;
-      case 's':
-        single = true;
-        break;
-      case 'u':
-        versioned = true;
-        break;
-      case 'l':
-        try
-          {
-            interestLifetime = boost::lexical_cast<int>(optarg);
-          }
-        catch (const boost::bad_lexical_cast&)
-          {
-            std::cerr << "ERROR: -l option should be an integer." << std::endl;
-            return 1;
-          }
-        interestLifetime = std::max(interestLifetime, 0);
-        break;
-      case 'w':
-        try
-          {
-            timeout = boost::lexical_cast<int>(optarg);
-          }
-        catch (const boost::bad_lexical_cast&)
-          {
-            std::cerr << "ERROR: -w option should be an integer." << std::endl;
-            return 1;
-          }
-        timeout = std::max(timeout, 0);
-        break;
-      case 'o':
-        outputFile = optarg;
-        break;
-      default:
-        return usage(argv[0]);
+  while ((opt = getopt(argc, argv, "vsul:w:o:")) != -1) {
+    switch (opt) {
+    case 'v':
+      verbose = true;
+      break;
+    case 's':
+      single = true;
+      break;
+    case 'u':
+      versioned = true;
+      break;
+    case 'l':
+      try {
+        interestLifetime = boost::lexical_cast<int>(optarg);
       }
-    }
-
-  if (optind < argc)
-    {
-      name = argv[optind];
-    }
-
-  if (name.empty())
-    {
+      catch (const boost::bad_lexical_cast&) {
+        std::cerr << "ERROR: -l option should be an integer." << std::endl;
+        return 1;
+      }
+      interestLifetime = std::max(interestLifetime, 0);
+      break;
+    case 'w':
+      try {
+        timeout = boost::lexical_cast<int>(optarg);
+      }
+      catch (const boost::bad_lexical_cast&) {
+        std::cerr << "ERROR: -w option should be an integer." << std::endl;
+        return 1;
+      }
+      timeout = std::max(timeout, 0);
+      break;
+    case 'o':
+      outputFile = optarg;
+      break;
+    default:
       return usage(argv[0]);
     }
+  }
+
+  if (optind < argc)
+    name = argv[optind];
+
+  if (name.empty())
+    return usage(argv[0]);
 
   std::streambuf* buf;
   std::ofstream of;
 
-  if (outputFile != 0)
-    {
-      of.open(outputFile, std::ios::out | std::ios::binary | std::ios::trunc);
-      if (!of || !of.is_open()) {
-        std::cerr << "ERROR: cannot open " << outputFile << std::endl;
-        return 1;
-      }
-      buf = of.rdbuf();
+  if (outputFile != nullptr) {
+    of.open(outputFile, std::ios::out | std::ios::binary | std::ios::trunc);
+    if (!of || !of.is_open()) {
+      std::cerr << "ERROR: cannot open " << outputFile << std::endl;
+      return 1;
     }
-  else
-    {
-      buf = std::cout.rdbuf();
-    }
+    buf = of.rdbuf();
+  }
+  else {
+    buf = std::cout.rdbuf();
+  }
 
   std::ostream os(buf);
+  Consumer consumer(name, os, verbose, versioned, single, interestLifetime, timeout);
 
-  Consumer consumer(name, os, verbose, versioned, single,
-                    interestLifetime, timeout);
-
-  try
-    {
-      consumer.run();
-    }
-  catch (const std::exception& e)
-    {
-      std::cerr << "ERROR: " << e.what() << std::endl;
-    }
+  try {
+    consumer.run();
+  }
+  catch (const std::exception& e) {
+    std::cerr << "ERROR: " << e.what() << std::endl;
+  }
 
   return 0;
 }
diff --git a/wscript b/wscript
index a4b84fe..48f296a 100644
--- a/wscript
+++ b/wscript
@@ -7,8 +7,9 @@
 import os
 
 def options(opt):
-    opt.load('compiler_c compiler_cxx gnu_dirs')
-    opt.load('boost default-compiler-flags doxygen sqlite3 coverage sanitizers',
+    opt.load(['compiler_cxx', 'gnu_dirs'])
+    opt.load(['default-compiler-flags', 'coverage', 'sanitizers', 'boost',
+              'sqlite3', 'doxygen'],
              tooldir=['.waf-tools'])
 
     ropt = opt.add_option_group('ndn-repo-ng Options')
@@ -21,7 +22,8 @@
                     help='''Do not build tools''')
 
 def configure(conf):
-    conf.load("compiler_c compiler_cxx gnu_dirs boost default-compiler-flags sqlite3")
+    conf.load(['compiler_cxx', 'gnu_dirs',
+               'default-compiler-flags', 'boost', 'sqlite3'])
 
     if 'PKG_CONFIG_PATH' not in os.environ:
         os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
@@ -45,9 +47,10 @@
     except:
         pass
 
+    conf.check_compiler_flags()
+
     # Loading "late" to prevent tests from being compiled with profiling flags
     conf.load('coverage')
-
     conf.load('sanitizers')
 
     conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/repo-ng.conf' % conf.env['SYSCONFDIR'])
