diff --git a/examples/custom-apps/custom-app.cpp b/examples/custom-apps/custom-app.cpp
index 71ca87e..001c440 100644
--- a/examples/custom-apps/custom-app.cpp
+++ b/examples/custom-apps/custom-app.cpp
@@ -33,112 +33,110 @@
 #include "ns3/ndn-fib.hpp"
 #include "ns3/random-variable.h"
 
-NS_LOG_COMPONENT_DEFINE ("CustomApp");
+NS_LOG_COMPONENT_DEFINE("CustomApp");
 
 namespace ns3 {
 
-NS_OBJECT_ENSURE_REGISTERED (CustomApp);
+NS_OBJECT_ENSURE_REGISTERED(CustomApp);
 
 // register NS-3 type
 TypeId
-CustomApp::GetTypeId ()
+CustomApp::GetTypeId()
 {
-  static TypeId tid = TypeId ("CustomApp")
-    .SetParent<ndn::App> ()
-    .AddConstructor<CustomApp> ()
-    ;
+  static TypeId tid = TypeId("CustomApp").SetParent<ndn::App>().AddConstructor<CustomApp>();
   return tid;
 }
 
 // Processing upon start of the application
 void
-CustomApp::StartApplication ()
+CustomApp::StartApplication()
 {
   // initialize ndn::App
-  ndn::App::StartApplication ();
+  ndn::App::StartApplication();
 
   // Create a name components object for name ``/prefix/sub``
-  Ptr<ndn::Name> prefix = Create<ndn::Name> (); // now prefix contains ``/``
-  prefix->append ("prefix"); // now prefix contains ``/prefix``
-  prefix->append ("sub"); // now prefix contains ``/prefix/sub``
+  Ptr<ndn::Name> prefix = Create<ndn::Name>(); // now prefix contains ``/``
+  prefix->append("prefix");                    // now prefix contains ``/prefix``
+  prefix->append("sub");                       // now prefix contains ``/prefix/sub``
 
   /////////////////////////////////////////////////////////////////////////////
   // Creating FIB entry that ensures that we will receive incoming Interests //
   /////////////////////////////////////////////////////////////////////////////
 
   // Get FIB object
-  Ptr<ndn::Fib> fib = GetNode ()->GetObject<ndn::Fib> ();
+  Ptr<ndn::Fib> fib = GetNode()->GetObject<ndn::Fib>();
 
   // Add entry to FIB
   // Note that ``m_face`` is cretaed by ndn::App
-  Ptr<ndn::fib::Entry> fibEntry = fib->Add (*prefix, m_face, 0);
+  Ptr<ndn::fib::Entry> fibEntry = fib->Add(*prefix, m_face, 0);
 
-  Simulator::Schedule (Seconds (1.0), &CustomApp::SendInterest, this);
+  Simulator::Schedule(Seconds(1.0), &CustomApp::SendInterest, this);
 }
 
 // Processing when application is stopped
 void
-CustomApp::StopApplication ()
+CustomApp::StopApplication()
 {
   // cleanup ndn::App
-  ndn::App::StopApplication ();
+  ndn::App::StopApplication();
 }
 
 void
-CustomApp::SendInterest ()
+CustomApp::SendInterest()
 {
   /////////////////////////////////////
   // Sending one Interest packet out //
   /////////////////////////////////////
-  
-  Ptr<ndn::Name> prefix = Create<ndn::Name> ("/prefix/sub"); // another way to create name
+
+  Ptr<ndn::Name> prefix = Create<ndn::Name>("/prefix/sub"); // another way to create name
 
   // Create and configure ndn::Interest
-  Ptr<ndn::Interest> interest = Create<ndn::Interest> ();
-  UniformVariable rand (0,std::numeric_limits<uint32_t>::max ());
-  interest->SetNonce            (rand.GetValue ());
-  interest->SetName             (prefix);
-  interest->SetInterestLifetime (Seconds (1.0));
+  Ptr<ndn::Interest> interest = Create<ndn::Interest>();
+  UniformVariable rand(0, std::numeric_limits<uint32_t>::max());
+  interest->SetNonce(rand.GetValue());
+  interest->SetName(prefix);
+  interest->SetInterestLifetime(Seconds(1.0));
 
-  NS_LOG_DEBUG ("Sending Interest packet for " << *prefix);
-  
+  NS_LOG_DEBUG("Sending Interest packet for " << *prefix);
+
   // Call trace (for logging purposes)
-  m_transmittedInterests (interest, this, m_face);
+  m_transmittedInterests(interest, this, m_face);
 
-  m_face->ReceiveInterest (interest);
+  m_face->ReceiveInterest(interest);
 }
 
 // Callback that will be called when Interest arrives
 void
-CustomApp::OnInterest (Ptr<const ndn::Interest> interest)
+CustomApp::OnInterest(Ptr<const ndn::Interest> interest)
 {
-  ndn::App::OnInterest (interest);
-  
-  NS_LOG_DEBUG ("Received Interest packet for " << interest->GetName ());
+  ndn::App::OnInterest(interest);
+
+  NS_LOG_DEBUG("Received Interest packet for " << interest->GetName());
 
   // Create and configure ndn::Data and ndn::DataTail
   // (header is added in front of the packet, tail is added at the end of the packet)
 
   // Note that Interests send out by the app will not be sent back to the app !
-  
-  Ptr<ndn::Data> data = Create<ndn::Data> (Create<Packet> (1024));
-  data->SetName (Create<ndn::Name> (interest->GetName ())); // data will have the same name as Interests
 
-  NS_LOG_DEBUG ("Sending Data packet for " << data->GetName ());  
+  Ptr<ndn::Data> data = Create<ndn::Data>(Create<Packet>(1024));
+  data->SetName(
+    Create<ndn::Name>(interest->GetName())); // data will have the same name as Interests
+
+  NS_LOG_DEBUG("Sending Data packet for " << data->GetName());
 
   // Call trace (for logging purposes)
-  m_transmittedDatas (data, this, m_face);
+  m_transmittedDatas(data, this, m_face);
 
-  m_face->ReceiveData (data); 
+  m_face->ReceiveData(data);
 }
 
 // Callback that will be called when Data arrives
 void
-CustomApp::OnData (Ptr<const ndn::Data> contentObject)
+CustomApp::OnData(Ptr<const ndn::Data> contentObject)
 {
-  NS_LOG_DEBUG ("Receiving Data packet for " << contentObject->GetName ());
+  NS_LOG_DEBUG("Receiving Data packet for " << contentObject->GetName());
 
-  std::cout << "DATA received for name " << contentObject->GetName () << std::endl;
+  std::cout << "DATA received for name " << contentObject->GetName() << std::endl;
 }
 
 } // namespace ns3
diff --git a/examples/custom-apps/custom-app.hpp b/examples/custom-apps/custom-app.hpp
index 86f7bb4..5d05e99 100644
--- a/examples/custom-apps/custom-app.hpp
+++ b/examples/custom-apps/custom-app.hpp
@@ -37,32 +37,31 @@
  *
  * When an Interest is received, it is replied with a Data with 1024-byte fake payload
  */
-class CustomApp : public ndn::App
-{
+class CustomApp : public ndn::App {
 public:
   // register NS-3 type "CustomApp"
   static TypeId
-  GetTypeId ();
-  
+  GetTypeId();
+
   // (overridden from ndn::App) Processing upon start of the application
   virtual void
-  StartApplication ();
+  StartApplication();
 
   // (overridden from ndn::App) Processing when application is stopped
   virtual void
-  StopApplication ();
+  StopApplication();
 
   // (overridden from ndn::App) Callback that will be called when Interest arrives
   virtual void
-  OnInterest (Ptr<const ndn::Interest> interest);
+  OnInterest(Ptr<const ndn::Interest> interest);
 
   // (overridden from ndn::App) Callback that will be called when Data arrives
   virtual void
-  OnData (Ptr<const ndn::Data> contentObject);
+  OnData(Ptr<const ndn::Data> contentObject);
 
 private:
   void
-  SendInterest ();
+  SendInterest();
 };
 
 } // namespace ns3
diff --git a/examples/custom-apps/dumb-requester.cpp b/examples/custom-apps/dumb-requester.cpp
index eca1cf2..f81548f 100644
--- a/examples/custom-apps/dumb-requester.cpp
+++ b/examples/custom-apps/dumb-requester.cpp
@@ -32,88 +32,85 @@
 #include "ns3/ndn-interest.hpp"
 #include "ns3/ndn-data.hpp"
 
-NS_LOG_COMPONENT_DEFINE ("DumbRequester");
+NS_LOG_COMPONENT_DEFINE("DumbRequester");
 
 namespace ns3 {
 
-NS_OBJECT_ENSURE_REGISTERED (DumbRequester);
+NS_OBJECT_ENSURE_REGISTERED(DumbRequester);
 
 // register NS-3 type
 TypeId
-DumbRequester::GetTypeId ()
+DumbRequester::GetTypeId()
 {
-  static TypeId tid = TypeId ("DumbRequester")
-    .SetParent<ndn::App> ()
-    .AddConstructor<DumbRequester> ()
+  static TypeId tid =
+    TypeId("DumbRequester")
+      .SetParent<ndn::App>()
+      .AddConstructor<DumbRequester>()
 
-    .AddAttribute ("Prefix", "Requested name",
-                   StringValue ("/dumb-interest"),
-                   ndn::MakeNameAccessor (&DumbRequester::m_name),
-                   ndn::MakeNameChecker ())
-    ;
+      .AddAttribute("Prefix", "Requested name", StringValue("/dumb-interest"),
+                    ndn::MakeNameAccessor(&DumbRequester::m_name), ndn::MakeNameChecker());
   return tid;
 }
 
-DumbRequester::DumbRequester ()
-  : m_isRunning (false)
+DumbRequester::DumbRequester()
+  : m_isRunning(false)
 {
 }
 
 // Processing upon start of the application
 void
-DumbRequester::StartApplication ()
+DumbRequester::StartApplication()
 {
   // initialize ndn::App
-  ndn::App::StartApplication ();
+  ndn::App::StartApplication();
 
   m_isRunning = true;
-  Simulator::ScheduleNow (&DumbRequester::SendInterest, this);
+  Simulator::ScheduleNow(&DumbRequester::SendInterest, this);
 }
 
 // Processing when application is stopped
 void
-DumbRequester::StopApplication ()
+DumbRequester::StopApplication()
 {
   m_isRunning = false;
   // cleanup ndn::App
-  ndn::App::StopApplication ();
+  ndn::App::StopApplication();
 }
 
 void
-DumbRequester::SendInterest ()
+DumbRequester::SendInterest()
 {
-  if (!m_isRunning) return;
-  
+  if (!m_isRunning)
+    return;
+
   /////////////////////////////////////
   // Sending one Interest packet out //
   /////////////////////////////////////
-  
-  Ptr<ndn::Name> prefix = Create<ndn::Name> (m_name); // another way to create name
+
+  Ptr<ndn::Name> prefix = Create<ndn::Name>(m_name); // another way to create name
 
   // Create and configure ndn::Interest
-  Ptr<ndn::Interest> interest = Create<ndn::Interest> ();
-  UniformVariable rand (0,std::numeric_limits<uint32_t>::max ());
-  interest->SetNonce            (rand.GetValue ());
-  interest->SetName             (prefix);
-  interest->SetInterestLifetime (Seconds (1.0));
+  Ptr<ndn::Interest> interest = Create<ndn::Interest>();
+  UniformVariable rand(0, std::numeric_limits<uint32_t>::max());
+  interest->SetNonce(rand.GetValue());
+  interest->SetName(prefix);
+  interest->SetInterestLifetime(Seconds(1.0));
 
-  NS_LOG_DEBUG ("Sending Interest packet for " << *prefix);
-  
+  NS_LOG_DEBUG("Sending Interest packet for " << *prefix);
 
   // Call trace (for logging purposes)
-  m_transmittedInterests (interest, this, m_face);
+  m_transmittedInterests(interest, this, m_face);
 
   // Forward packet to lower (network) layer
-  m_face->ReceiveInterest (interest);
+  m_face->ReceiveInterest(interest);
 
-  Simulator::Schedule (Seconds (1.0), &DumbRequester::SendInterest, this);
+  Simulator::Schedule(Seconds(1.0), &DumbRequester::SendInterest, this);
 }
 
 void
-DumbRequester::OnData (Ptr<const ndn::Data> contentObject)
+DumbRequester::OnData(Ptr<const ndn::Data> contentObject)
 {
-  NS_LOG_DEBUG ("Receiving Data packet for " << contentObject->GetName ());
+  NS_LOG_DEBUG("Receiving Data packet for " << contentObject->GetName());
 }
 
-
 } // namespace ns3
diff --git a/examples/custom-apps/dumb-requester.hpp b/examples/custom-apps/dumb-requester.hpp
index 7a1272d..55bdace 100644
--- a/examples/custom-apps/dumb-requester.hpp
+++ b/examples/custom-apps/dumb-requester.hpp
@@ -31,32 +31,31 @@
 /**
  * @brief A dumb requester application
  *
- * This app keeps requesting every second the same content object 
+ * This app keeps requesting every second the same content object
  */
-class DumbRequester : public ndn::App
-{
+class DumbRequester : public ndn::App {
 public:
   // register NS-3 type "DumbRequester"
   static TypeId
-  GetTypeId ();
+  GetTypeId();
 
-  DumbRequester ();
-  
+  DumbRequester();
+
   // (overridden from ndn::App) Processing upon start of the application
   virtual void
-  StartApplication ();
+  StartApplication();
 
   // (overridden from ndn::App) Processing when application is stopped
   virtual void
-  StopApplication ();
+  StopApplication();
 
   // (overridden from ndn::App) Callback that will be called when Data arrives
   virtual void
-  OnData (Ptr<const ndn::Data> contentObject);
-  
+  OnData(Ptr<const ndn::Data> contentObject);
+
 private:
   void
-  SendInterest ();
+  SendInterest();
 
 private:
   bool m_isRunning;
diff --git a/examples/custom-apps/hijacker.cpp b/examples/custom-apps/hijacker.cpp
index f1852d4..bcff26a 100644
--- a/examples/custom-apps/hijacker.cpp
+++ b/examples/custom-apps/hijacker.cpp
@@ -23,53 +23,49 @@
 #include "hijacker.hpp"
 #include "ns3/ndn-name.hpp"
 
-NS_LOG_COMPONENT_DEFINE ("Hijacker");
+NS_LOG_COMPONENT_DEFINE("Hijacker");
 
 namespace ns3 {
 
 // Necessary if you are planning to use ndn::AppHelper
-NS_OBJECT_ENSURE_REGISTERED (Hijacker);
+NS_OBJECT_ENSURE_REGISTERED(Hijacker);
 
 TypeId
-Hijacker::GetTypeId ()
+Hijacker::GetTypeId()
 {
-  static TypeId tid = TypeId ("Hijacker")
-    .SetParent<ndn::App> ()
-    .AddConstructor<Hijacker> ()
-    ;
+  static TypeId tid = TypeId("Hijacker").SetParent<ndn::App>().AddConstructor<Hijacker>();
 
   return tid;
 }
 
-Hijacker::Hijacker ()
+Hijacker::Hijacker()
 {
 }
 
 void
-Hijacker::OnInterest (Ptr<const ndn::Interest> interest)
+Hijacker::OnInterest(Ptr<const ndn::Interest> interest)
 {
-  ndn::App::OnInterest (interest); // forward call to perform app-level tracing
+  ndn::App::OnInterest(interest); // forward call to perform app-level tracing
   // do nothing else (hijack interest)
 
-  NS_LOG_DEBUG ("Do nothing for incoming interest for" << interest->GetName ());
+  NS_LOG_DEBUG("Do nothing for incoming interest for" << interest->GetName());
 }
 
 void
-Hijacker::StartApplication ()
+Hijacker::StartApplication()
 {
-  App::StartApplication ();
+  App::StartApplication();
 
   // equivalent to setting interest filter for "/" prefix
-  Ptr<ndn::Fib> fib = GetNode ()->GetObject<ndn::Fib> ();
-  Ptr<ndn::fib::Entry> fibEntry = fib->Add (ndn::Name ("/"), m_face, 0);
-  fibEntry->UpdateStatus (m_face, ndn::fib::FaceMetric::NDN_FIB_GREEN);
+  Ptr<ndn::Fib> fib = GetNode()->GetObject<ndn::Fib>();
+  Ptr<ndn::fib::Entry> fibEntry = fib->Add(ndn::Name("/"), m_face, 0);
+  fibEntry->UpdateStatus(m_face, ndn::fib::FaceMetric::NDN_FIB_GREEN);
 }
 
 void
-Hijacker::StopApplication ()
+Hijacker::StopApplication()
 {
-  App::StopApplication ();
+  App::StopApplication();
 }
 
 } // namespace ns3
-
diff --git a/examples/custom-apps/hijacker.hpp b/examples/custom-apps/hijacker.hpp
index a90166d..a794f12 100644
--- a/examples/custom-apps/hijacker.hpp
+++ b/examples/custom-apps/hijacker.hpp
@@ -29,25 +29,24 @@
 
 namespace ns3 {
 
-class Hijacker : public ndn::App
-{
+class Hijacker : public ndn::App {
 public:
   static TypeId
-  GetTypeId ();
+  GetTypeId();
 
-  Hijacker ();
+  Hijacker();
 
   // Receive all Interests but do nothing in response
   void
-  OnInterest (Ptr<const ndn::Interest> interest);
+  OnInterest(Ptr<const ndn::Interest> interest);
 
 protected:
   // inherited from Application base class.
   virtual void
-  StartApplication ();
+  StartApplication();
 
   virtual void
-  StopApplication ();
+  StopApplication();
 };
 
 } // namespace ns3
diff --git a/examples/ndn-congestion-alt-topo-plugin.cpp b/examples/ndn-congestion-alt-topo-plugin.cpp
index b591250..9491be4 100644
--- a/examples/ndn-congestion-alt-topo-plugin.cpp
+++ b/examples/ndn-congestion-alt-topo-plugin.cpp
@@ -31,25 +31,25 @@
  *   /------\ 0                                                 0 /------\
  *   |  c1  |<-----+                                       +----->|  p1  |
  *   \------/       \                                     /       \------/
- *                   \              /-----\              /        
+ *                   \              /-----\              /
  *   /------\ 0       \         +==>| r12 |<==+         /       0 /------\
  *   |  c2  |<--+      \       /    \-----/    \       /      +-->|  p2  |
  *   \------/    \      \     |                 |     /      /    \------/
- *                \      |    |   1Mbps links   |    |      /     
- *                 \  1  v0   v5               1v   2v  3  /      
- *                  +->/------\                 /------\<-+       
- *                    2|  r1  |<===============>|  r2  |4         
- *                  +->\------/4               0\------/<-+       
- *                 /    3^                           ^5    \      
- *                /      |                           |      \     
+ *                \      |    |   1Mbps links   |    |      /
+ *                 \  1  v0   v5               1v   2v  3  /
+ *                  +->/------\                 /------\<-+
+ *                    2|  r1  |<===============>|  r2  |4
+ *                  +->\------/4               0\------/<-+
+ *                 /    3^                           ^5    \
+ *                /      |                           |      \
  *   /------\ 0  /      /                             \      \  0 /------\
  *   |  c3  |<--+      /                               \      +-->|  p3  |
  *   \------/         /                                 \         \------/
- *                   /     "All consumer-router and"     \        
+ *                   /     "All consumer-router and"     \
  *   /------\ 0     /      "router-producer links are"    \    0 /------\
  *   |  c4  |<-----+       "10Mbps"                        +---->|  p4  |
  *   \------/                                                    \------/
- *                                                               
+ *
  *   "Numbers near nodes denote face IDs. Face ID is assigned based on the order of link"
  *   "definitions in the topology file"
  *
@@ -59,81 +59,81 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
-  AnnotatedTopologyReader topologyReader ("", 1);
-  topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-11-node-two-bottlenecks.txt");
-  topologyReader.Read ();
+  AnnotatedTopologyReader topologyReader("", 1);
+  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-11-node-two-bottlenecks.txt");
+  topologyReader.Read();
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::CustomStrategy");
-  ndnHelper.SetContentStore ("ns3::ndn::cs::Lru",
-                              "MaxSize", "1"); // ! Attention ! If set to 0, then MaxSize is infinite
-  ndnHelper.InstallAll ();
+  ndnHelper.SetForwardingStrategy("ns3::ndn::fw::CustomStrategy");
+  ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize",
+                            "1"); // ! Attention ! If set to 0, then MaxSize is infinite
+  ndnHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> consumers[4] = { Names::Find<Node> ("c1"), Names::Find<Node> ("c2"), Names::Find<Node> ("c3"), Names::Find<Node> ("c4") };
-  Ptr<Node> producers[4] = { Names::Find<Node> ("p1"), Names::Find<Node> ("p2"), Names::Find<Node> ("p3"), Names::Find<Node> ("p4") };
+  Ptr<Node> consumers[4] = {Names::Find<Node>("c1"), Names::Find<Node>("c2"),
+                            Names::Find<Node>("c3"), Names::Find<Node>("c4")};
+  Ptr<Node> producers[4] = {Names::Find<Node>("p1"), Names::Find<Node>("p2"),
+                            Names::Find<Node>("p3"), Names::Find<Node>("p4")};
 
-  if (consumers[0] == 0 || consumers[1] == 0 || consumers[2] == 0 || consumers[3] == 0 ||
-      producers[0] == 0 || producers[1] == 0 || producers[2] == 0 || producers[3] == 0)
-    {
-      NS_FATAL_ERROR ("Error in topology: one nodes c1, c2, c3, c4, p1, p2, p3, or p4 is missing");
-    }
+  if (consumers[0] == 0 || consumers[1] == 0 || consumers[2] == 0 || consumers[3] == 0
+      || producers[0] == 0 || producers[1] == 0 || producers[2] == 0 || producers[3] == 0) {
+    NS_FATAL_ERROR("Error in topology: one nodes c1, c2, c3, c4, p1, p2, p3, or p4 is missing");
+  }
 
-  for (int i = 0; i < 4; i++)
-    {
-      std::string prefix = "/data/"+Names::FindName (producers[i]);
-      
-      /////////////////////////////////////////////////////////////////////////////////
-      // install consumer app on consumer node c_i to request data from producer p_i //
-      /////////////////////////////////////////////////////////////////////////////////
+  for (int i = 0; i < 4; i++) {
+    std::string prefix = "/data/" + Names::FindName(producers[i]);
 
-      ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-      consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 100 interests a second
-      
-      consumerHelper.SetPrefix (prefix);
-      ApplicationContainer consumer = consumerHelper.Install (consumers[i]);
-      consumer.Start (Seconds (i));    // start consumers at 0s, 1s, 2s, 3s
-      consumer.Stop  (Seconds (19-i)); // stop consumers at 19s, 18s, 17s, 16s
-      
-      ///////////////////////////////////////////////
-      // install producer app on producer node p_i //
-      ///////////////////////////////////////////////
-            
-      ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-      producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));  
+    /////////////////////////////////////////////////////////////////////////////////
+    // install consumer app on consumer node c_i to request data from producer p_i //
+    /////////////////////////////////////////////////////////////////////////////////
 
-      // install producer that will satisfy Interests in /dst1 namespace
-      producerHelper.SetPrefix (prefix);
-      ApplicationContainer producer = producerHelper.Install (producers[i]);
-      // when Start/Stop time is not specified, the application is running throughout the simulation
-    }
+    ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+    consumerHelper.SetAttribute("Frequency", StringValue("10")); // 100 interests a second
+
+    consumerHelper.SetPrefix(prefix);
+    ApplicationContainer consumer = consumerHelper.Install(consumers[i]);
+    consumer.Start(Seconds(i));     // start consumers at 0s, 1s, 2s, 3s
+    consumer.Stop(Seconds(19 - i)); // stop consumers at 19s, 18s, 17s, 16s
+
+    ///////////////////////////////////////////////
+    // install producer app on producer node p_i //
+    ///////////////////////////////////////////////
+
+    ndn::AppHelper producerHelper("ns3::ndn::Producer");
+    producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+
+    // install producer that will satisfy Interests in /dst1 namespace
+    producerHelper.SetPrefix(prefix);
+    ApplicationContainer producer = producerHelper.Install(producers[i]);
+    // when Start/Stop time is not specified, the application is running throughout the simulation
+  }
 
   // Manually configure FIB routes
-  ndn::StackHelper::AddRoute	("c1", "/data", "n1", 1); // link to n1
-  ndn::StackHelper::AddRoute	("c2", "/data", "n1", 1); // link to n1
-  ndn::StackHelper::AddRoute	("c3", "/data", "n1", 1); // link to n1
-  ndn::StackHelper::AddRoute	("c4", "/data", "n1", 1); // link to n1
+  ndn::StackHelper::AddRoute("c1", "/data", "n1", 1); // link to n1
+  ndn::StackHelper::AddRoute("c2", "/data", "n1", 1); // link to n1
+  ndn::StackHelper::AddRoute("c3", "/data", "n1", 1); // link to n1
+  ndn::StackHelper::AddRoute("c4", "/data", "n1", 1); // link to n1
 
-  ndn::StackHelper::AddRoute	("n1", "/data", "n2", 1); // link to n2
-  ndn::StackHelper::AddRoute	("n1", "/data", "n12", 2); // link to n12
+  ndn::StackHelper::AddRoute("n1", "/data", "n2", 1);  // link to n2
+  ndn::StackHelper::AddRoute("n1", "/data", "n12", 2); // link to n12
 
-  ndn::StackHelper::AddRoute	("n12", "/data", "n2", 1); // link to n2
+  ndn::StackHelper::AddRoute("n12", "/data", "n2", 1); // link to n2
 
-  ndn::StackHelper::AddRoute	("n2", "/data/p1", "p1", 1); // link to p1
-  ndn::StackHelper::AddRoute	("n2", "/data/p2", "p2", 1); // link to p2
-  ndn::StackHelper::AddRoute	("n2", "/data/p3", "p3", 1); // link to p3
-  ndn::StackHelper::AddRoute	("n2", "/data/p4", "p4", 1); // link to p4
+  ndn::StackHelper::AddRoute("n2", "/data/p1", "p1", 1); // link to p1
+  ndn::StackHelper::AddRoute("n2", "/data/p2", "p2", 1); // link to p2
+  ndn::StackHelper::AddRoute("n2", "/data/p3", "p3", 1); // link to p3
+  ndn::StackHelper::AddRoute("n2", "/data/p4", "p4", 1); // link to p4
 
   // Schedule simulation time and run the simulation
-  Simulator::Stop (Seconds (20.0));
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Stop(Seconds(20.0));
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-congestion-topo-plugin.cpp b/examples/ndn-congestion-topo-plugin.cpp
index 77069ee..0a6a58b 100644
--- a/examples/ndn-congestion-topo-plugin.cpp
+++ b/examples/ndn-congestion-topo-plugin.cpp
@@ -30,10 +30,10 @@
  *   /------\	                                                 /------\
  *   | Src1 |<--+                                            +-->| Dst1 |
  *   \------/    \                                          /    \------/
- *            	 \                                        /     
- *                 +-->/------\   "bottleneck"  /------\<-+      
- *                     | Rtr1 |<===============>| Rtr2 |         
- *                 +-->\------/                 \------/<-+      
+ *            	 \                                        /
+ *                 +-->/------\   "bottleneck"  /------\<-+
+ *                     | Rtr1 |<===============>| Rtr2 |
+ *                 +-->\------/                 \------/<-+
  *                /                                        \
  *   /------\    /                                          \    /------\
  *   | Src2 |<--+                                            +-->| Dst2 |
@@ -45,68 +45,67 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
-  AnnotatedTopologyReader topologyReader ("", 25);
-  topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-6-node.txt");
-  topologyReader.Read ();
+  AnnotatedTopologyReader topologyReader("", 25);
+  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-6-node.txt");
+  topologyReader.Read();
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ndnHelper.SetContentStore ("ns3::ndn::cs::Lru",
-                              "MaxSize", "10000");
-  ndnHelper.InstallAll ();
+  ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "10000");
+  ndnHelper.InstallAll();
 
   // Installing global routing interface on all nodes
   ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
-  ndnGlobalRoutingHelper.InstallAll ();
+  ndnGlobalRoutingHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> consumer1 = Names::Find<Node> ("Src1");
-  Ptr<Node> consumer2 = Names::Find<Node> ("Src2");
+  Ptr<Node> consumer1 = Names::Find<Node>("Src1");
+  Ptr<Node> consumer2 = Names::Find<Node>("Src2");
 
-  Ptr<Node> producer1 = Names::Find<Node> ("Dst1");
-  Ptr<Node> producer2 = Names::Find<Node> ("Dst2");
+  Ptr<Node> producer1 = Names::Find<Node>("Dst1");
+  Ptr<Node> producer2 = Names::Find<Node>("Dst2");
 
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-  consumerHelper.SetAttribute ("Frequency", StringValue ("100")); // 100 interests a second
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+  consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
 
   // on the first consumer node install a Consumer application
   // that will express interests in /dst1 namespace
-  consumerHelper.SetPrefix ("/dst1");
-  consumerHelper.Install (consumer1);
+  consumerHelper.SetPrefix("/dst1");
+  consumerHelper.Install(consumer1);
 
   // on the second consumer node install a Consumer application
   // that will express interests in /dst2 namespace
-  consumerHelper.SetPrefix ("/dst2");
-  consumerHelper.Install (consumer2);
-  
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));  
+  consumerHelper.SetPrefix("/dst2");
+  consumerHelper.Install(consumer2);
+
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
 
   // Register /dst1 prefix with global routing controller and
   // install producer that will satisfy Interests in /dst1 namespace
-  ndnGlobalRoutingHelper.AddOrigins ("/dst1", producer1);
-  producerHelper.SetPrefix ("/dst1");
-  producerHelper.Install (producer1);
+  ndnGlobalRoutingHelper.AddOrigins("/dst1", producer1);
+  producerHelper.SetPrefix("/dst1");
+  producerHelper.Install(producer1);
 
   // Register /dst2 prefix with global routing controller and
   // install producer that will satisfy Interests in /dst2 namespace
-  ndnGlobalRoutingHelper.AddOrigins ("/dst2", producer2);
-  producerHelper.SetPrefix ("/dst2");
-  producerHelper.Install (producer2);
+  ndnGlobalRoutingHelper.AddOrigins("/dst2", producer2);
+  producerHelper.SetPrefix("/dst2");
+  producerHelper.Install(producer2);
 
   // Calculate and install FIBs
-  ndn::GlobalRoutingHelper::CalculateRoutes ();
+  ndn::GlobalRoutingHelper::CalculateRoutes();
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-csma.cpp b/examples/ndn-csma.cpp
index cafddd5..71d1cfb 100644
--- a/examples/ndn-csma.cpp
+++ b/examples/ndn-csma.cpp
@@ -48,51 +48,51 @@
  *     NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-csma
  */
 
-int 
-main (int argc, char *argv[])
+int
+main(int argc, char* argv[])
 {
   // setting default parameters for PointToPoint links and channels
-  Config::SetDefault ("ns3::CsmaChannel::DataRate", StringValue ("1Mbps"));
-  Config::SetDefault ("ns3::CsmaChannel::Delay", StringValue ("10ms"));
-  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+  Config::SetDefault("ns3::CsmaChannel::DataRate", StringValue("1Mbps"));
+  Config::SetDefault("ns3::CsmaChannel::Delay", StringValue("10ms"));
+  Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
 
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
   // Creating nodes
   NodeContainer nodes;
-  nodes.Create (3);
+  nodes.Create(3);
 
   // Connecting nodes using two links
   CsmaHelper csma;
-  csma.Install (nodes);
+  csma.Install(nodes);
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetDefaultRoutes (true);
-  ndnHelper.InstallAll ();
+  ndnHelper.SetDefaultRoutes(true);
+  ndnHelper.InstallAll();
 
   // Installing applications
 
   // Consumer
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
   // Consumer will request /prefix/0, /prefix/1, ...
-  consumerHelper.SetPrefix ("/prefix");
-  consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
-  consumerHelper.Install (nodes.Get (0)); // first node
+  consumerHelper.SetPrefix("/prefix");
+  consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
+  consumerHelper.Install(nodes.Get(0));                        // first node
 
   // Producer
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
   // Producer will reply to all requests starting with /prefix
-  producerHelper.SetPrefix ("/prefix");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
-  producerHelper.Install (nodes.Get (2)); // last node
+  producerHelper.SetPrefix("/prefix");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+  producerHelper.Install(nodes.Get(2)); // last node
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-grid-topo-plugin.cpp b/examples/ndn-grid-topo-plugin.cpp
index bbb8e86..84f5f17 100644
--- a/examples/ndn-grid-topo-plugin.cpp
+++ b/examples/ndn-grid-topo-plugin.cpp
@@ -33,7 +33,7 @@
  *     |          |         |
  *    ( ) ------ ( ) -- (producer)
  *
- * All links are 1Mbps with propagation 10ms delay. 
+ * All links are 1Mbps with propagation 10ms delay.
  *
  * FIB is populated using NdnGlobalRoutingHelper.
  *
@@ -49,52 +49,52 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
-  AnnotatedTopologyReader topologyReader ("", 25);
-  topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-grid-3x3.txt");
-  topologyReader.Read ();
+  AnnotatedTopologyReader topologyReader("", 25);
+  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-grid-3x3.txt");
+  topologyReader.Read();
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ndnHelper.InstallAll ();
+  ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ndnHelper.InstallAll();
 
   // Installing global routing interface on all nodes
   ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
-  ndnGlobalRoutingHelper.InstallAll ();
+  ndnGlobalRoutingHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> producer = Names::Find<Node> ("Node8");
+  Ptr<Node> producer = Names::Find<Node>("Node8");
   NodeContainer consumerNodes;
-  consumerNodes.Add (Names::Find<Node> ("Node0"));
+  consumerNodes.Add(Names::Find<Node>("Node0"));
 
   // Install NDN applications
   std::string prefix = "/prefix";
 
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-  consumerHelper.SetPrefix (prefix);
-  consumerHelper.SetAttribute ("Frequency", StringValue ("100")); // 100 interests a second
-  consumerHelper.Install (consumerNodes);
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+  consumerHelper.SetPrefix(prefix);
+  consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
+  consumerHelper.Install(consumerNodes);
 
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetPrefix (prefix);
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
-  producerHelper.Install (producer);
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetPrefix(prefix);
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+  producerHelper.Install(producer);
 
   // Add /prefix origins to ndn::GlobalRouter
-  ndnGlobalRoutingHelper.AddOrigins (prefix, producer);
+  ndnGlobalRoutingHelper.AddOrigins(prefix, producer);
 
   // Calculate and install FIBs
-  ndn::GlobalRoutingHelper::CalculateRoutes ();
+  ndn::GlobalRoutingHelper::CalculateRoutes();
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-grid.cpp b/examples/ndn-grid.cpp
index 8b75165..d475dfd 100644
--- a/examples/ndn-grid.cpp
+++ b/examples/ndn-grid.cpp
@@ -35,7 +35,7 @@
  *     |          |         |
  *    ( ) ------ ( ) -- (producer)
  *
- * All links are 1Mbps with propagation 10ms delay. 
+ * All links are 1Mbps with propagation 10ms delay.
  *
  * FIB is populated using NdnGlobalRoutingHelper.
  *
@@ -51,59 +51,59 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   // Setting default parameters for PointToPoint links and channels
-  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
-  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
-  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("10"));
+  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
+  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
+  Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("10"));
 
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
   // Creating 3x3 topology
   PointToPointHelper p2p;
-  PointToPointGridHelper grid (3, 3, p2p);
-  grid.BoundingBox(100,100,200,200);
+  PointToPointGridHelper grid(3, 3, p2p);
+  grid.BoundingBox(100, 100, 200, 200);
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ndnHelper.InstallAll ();
+  ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ndnHelper.InstallAll();
 
   // Installing global routing interface on all nodes
   ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
-  ndnGlobalRoutingHelper.InstallAll ();
+  ndnGlobalRoutingHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> producer = grid.GetNode (2, 2);
+  Ptr<Node> producer = grid.GetNode(2, 2);
   NodeContainer consumerNodes;
-  consumerNodes.Add (grid.GetNode (0,0));
+  consumerNodes.Add(grid.GetNode(0, 0));
 
   // Install NDN applications
   std::string prefix = "/prefix";
 
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-  consumerHelper.SetPrefix (prefix);
-  consumerHelper.SetAttribute ("Frequency", StringValue ("100")); // 100 interests a second
-  consumerHelper.Install (consumerNodes);
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+  consumerHelper.SetPrefix(prefix);
+  consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
+  consumerHelper.Install(consumerNodes);
 
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetPrefix (prefix);
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
-  producerHelper.Install (producer);
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetPrefix(prefix);
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+  producerHelper.Install(producer);
 
   // Add /prefix origins to ndn::GlobalRouter
-  ndnGlobalRoutingHelper.AddOrigins (prefix, producer);
+  ndnGlobalRoutingHelper.AddOrigins(prefix, producer);
 
   // Calculate and install FIBs
-  ndn::GlobalRoutingHelper::CalculateRoutes ();
+  ndn::GlobalRoutingHelper::CalculateRoutes();
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-simple-wifi.cpp b/examples/ndn-simple-wifi.cpp
index db54c93..a2b083f 100644
--- a/examples/ndn-simple-wifi.cpp
+++ b/examples/ndn-simple-wifi.cpp
@@ -30,10 +30,11 @@
 using namespace std;
 using namespace ns3;
 
-NS_LOG_COMPONENT_DEFINE ("ndn.WifiExample");
+NS_LOG_COMPONENT_DEFINE("ndn.WifiExample");
 
 //
-// DISCLAIMER:  Note that this is an extremely simple example, containing just 2 wifi nodes communicating
+// DISCLAIMER:  Note that this is an extremely simple example, containing just 2 wifi nodes
+// communicating
 //              directly over AdHoc channel.
 //
 
@@ -47,90 +48,89 @@
 // }
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   // disable fragmentation
-  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
-  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200"));
-  Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", StringValue ("OfdmRate24Mbps"));
+  Config::SetDefault("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue("2200"));
+  Config::SetDefault("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue("2200"));
+  Config::SetDefault("ns3::WifiRemoteStationManager::NonUnicastMode",
+                     StringValue("OfdmRate24Mbps"));
 
   CommandLine cmd;
-  cmd.Parse (argc,argv);
+  cmd.Parse(argc, argv);
 
   //////////////////////
   //////////////////////
   //////////////////////
-  WifiHelper wifi = WifiHelper::Default ();
+  WifiHelper wifi = WifiHelper::Default();
   // wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
-  wifi.SetStandard (WIFI_PHY_STANDARD_80211a);
-  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
-                                "DataMode", StringValue ("OfdmRate24Mbps"));
+  wifi.SetStandard(WIFI_PHY_STANDARD_80211a);
+  wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode",
+                               StringValue("OfdmRate24Mbps"));
 
-  YansWifiChannelHelper wifiChannel;// = YansWifiChannelHelper::Default ();
-  wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
-  wifiChannel.AddPropagationLoss ("ns3::ThreeLogDistancePropagationLossModel");
-  wifiChannel.AddPropagationLoss ("ns3::NakagamiPropagationLossModel");
+  YansWifiChannelHelper wifiChannel; // = YansWifiChannelHelper::Default ();
+  wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
+  wifiChannel.AddPropagationLoss("ns3::ThreeLogDistancePropagationLossModel");
+  wifiChannel.AddPropagationLoss("ns3::NakagamiPropagationLossModel");
 
-  //YansWifiPhy wifiPhy = YansWifiPhy::Default();
-  YansWifiPhyHelper wifiPhyHelper = YansWifiPhyHelper::Default ();
-  wifiPhyHelper.SetChannel (wifiChannel.Create ());
+  // YansWifiPhy wifiPhy = YansWifiPhy::Default();
+  YansWifiPhyHelper wifiPhyHelper = YansWifiPhyHelper::Default();
+  wifiPhyHelper.SetChannel(wifiChannel.Create());
   wifiPhyHelper.Set("TxPowerStart", DoubleValue(5));
   wifiPhyHelper.Set("TxPowerEnd", DoubleValue(5));
 
-
-  NqosWifiMacHelper wifiMacHelper = NqosWifiMacHelper::Default ();
+  NqosWifiMacHelper wifiMacHelper = NqosWifiMacHelper::Default();
   wifiMacHelper.SetType("ns3::AdhocWifiMac");
 
-  Ptr<UniformRandomVariable> randomizer = CreateObject<UniformRandomVariable> ();
-  randomizer->SetAttribute ("Min", DoubleValue (10));
-  randomizer->SetAttribute ("Max", DoubleValue (100));
+  Ptr<UniformRandomVariable> randomizer = CreateObject<UniformRandomVariable>();
+  randomizer->SetAttribute("Min", DoubleValue(10));
+  randomizer->SetAttribute("Max", DoubleValue(100));
 
   MobilityHelper mobility;
-  mobility.SetPositionAllocator ("ns3::RandomBoxPositionAllocator",
-                                 "X", PointerValue (randomizer),
-                                 "Y", PointerValue (randomizer),
-                                 "Z", PointerValue (randomizer));
+  mobility.SetPositionAllocator("ns3::RandomBoxPositionAllocator", "X", PointerValue(randomizer),
+                                "Y", PointerValue(randomizer), "Z", PointerValue(randomizer));
 
-  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
 
   NodeContainer nodes;
-  nodes.Create (2);
+  nodes.Create(2);
 
   ////////////////
   // 1. Install Wifi
-  NetDeviceContainer wifiNetDevices = wifi.Install (wifiPhyHelper, wifiMacHelper, nodes);
+  NetDeviceContainer wifiNetDevices = wifi.Install(wifiPhyHelper, wifiMacHelper, nodes);
 
   // 2. Install Mobility model
-  mobility.Install (nodes);
+  mobility.Install(nodes);
 
   // 3. Install NDN stack
-  NS_LOG_INFO ("Installing NDN stack");
+  NS_LOG_INFO("Installing NDN stack");
   ndn::StackHelper ndnHelper;
-  // ndnHelper.AddNetDeviceFaceCreateCallback (WifiNetDevice::GetTypeId (), MakeCallback (MyNetDeviceFaceCallback));
-  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ndnHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "1000");
-  ndnHelper.SetDefaultRoutes (true);
-  ndnHelper.Install (nodes);
+  // ndnHelper.AddNetDeviceFaceCreateCallback (WifiNetDevice::GetTypeId (), MakeCallback
+  // (MyNetDeviceFaceCallback));
+  ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000");
+  ndnHelper.SetDefaultRoutes(true);
+  ndnHelper.Install(nodes);
 
   // 4. Set up applications
-  NS_LOG_INFO ("Installing Applications");
+  NS_LOG_INFO("Installing Applications");
 
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-  consumerHelper.SetPrefix ("/test/prefix");
-  consumerHelper.SetAttribute ("Frequency", DoubleValue (10.0));
-  consumerHelper.Install (nodes.Get (0));
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+  consumerHelper.SetPrefix("/test/prefix");
+  consumerHelper.SetAttribute("Frequency", DoubleValue(10.0));
+  consumerHelper.Install(nodes.Get(0));
 
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetPrefix ("/");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1200"));
-  producerHelper.Install (nodes.Get (1));
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetPrefix("/");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1200"));
+  producerHelper.Install(nodes.Get(1));
 
   ////////////////
 
-  Simulator::Stop (Seconds (30.0));
+  Simulator::Stop(Seconds(30.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-simple-with-cs-lfu.cpp b/examples/ndn-simple-with-cs-lfu.cpp
index 4025763..d22a549 100644
--- a/examples/ndn-simple-with-cs-lfu.cpp
+++ b/examples/ndn-simple-with-cs-lfu.cpp
@@ -36,32 +36,40 @@
  *      | consumer | <------------> | router | <------------> | producer |
  *      +----------+         10ms   +--------+          10ms  +----------+
  *
- * This scenario demonstrates how to use content store that responds to Freshness parameter set in Datas.
- * That is, if producer set Freshness field to 2 seconds, the corresponding content object will not be cached
+ * This scenario demonstrates how to use content store that responds to Freshness parameter set in
+ *Datas.
+ * That is, if producer set Freshness field to 2 seconds, the corresponding content object will not
+ *be cached
  * more than 2 seconds (can be cached for a shorter time, if entry is evicted earlier)
  *
  *     NS_LOG=ndn.Consumer ./waf --run ndn-simple-with-cs-lfu
  */
 
-void PrintCsMemStatsHeader (std::ostream &os)
+void
+PrintCsMemStatsHeader(std::ostream& os)
 {
-  os << "SimulationTime" << "\t"
-     << "RealTime" << "\t"
+  os << "SimulationTime"
+     << "\t"
+     << "RealTime"
+     << "\t"
      // << "NumberOfProcessedData" << "\t"
      // << "NumberOfProcessedInterests" << "\t"
-     << "NumberPitEntries" << "\t"
-     << "NumberCsEntries" << "\t"
-     << "MemUsage" << "\n";
+     << "NumberPitEntries"
+     << "\t"
+     << "NumberCsEntries"
+     << "\t"
+     << "MemUsage"
+     << "\n";
 }
 
 void
-PrintCsMemStats (std::ostream &os, Time nextPrintTime, double beginRealTime)
+PrintCsMemStats(std::ostream& os, Time nextPrintTime, double beginRealTime)
 {
   ::timeval t;
   gettimeofday(&t, NULL);
   double realTime = t.tv_sec + (0.000001 * (unsigned)t.tv_usec) - beginRealTime;
 
-  os << Simulator::Now ().ToDouble (Time::S) << "\t";
+  os << Simulator::Now().ToDouble(Time::S) << "\t";
   os << realTime << "\t";
 
   // os << ndn::L3Protocol::GetDataCounter () << "\t";
@@ -69,91 +77,90 @@
 
   uint64_t pitCount = 0;
   uint64_t csCount = 0;
-  for (NodeList::Iterator node = NodeList::Begin ();
-       node != NodeList::End ();
-       node ++)
-    {
-      Ptr<ndn::Pit> pit = (*node)->GetObject<ndn::Pit> ();
-      Ptr<ndn::ContentStore> cs = (*node)->GetObject<ndn::ContentStore> ();
+  for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End(); node++) {
+    Ptr<ndn::Pit> pit = (*node)->GetObject<ndn::Pit>();
+    Ptr<ndn::ContentStore> cs = (*node)->GetObject<ndn::ContentStore>();
 
-      if (pit != 0)
-        pitCount += pit->GetSize ();
+    if (pit != 0)
+      pitCount += pit->GetSize();
 
-      if (cs != 0)
-        csCount += cs->GetSize ();
-    }
+    if (cs != 0)
+      csCount += cs->GetSize();
+  }
 
   os << pitCount << "\t";
   os << csCount << "\t";
-  os << MemUsage::Get () / 1024.0 / 1024.0 << "\n";
+  os << MemUsage::Get() / 1024.0 / 1024.0 << "\n";
 
-  Simulator::Schedule (nextPrintTime, PrintCsMemStats, boost::ref (os), nextPrintTime, beginRealTime);
+  Simulator::Schedule(nextPrintTime, PrintCsMemStats, boost::ref(os), nextPrintTime, beginRealTime);
 }
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   // setting default parameters for PointToPoint links and channels
-  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
-  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
-  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
+  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
+  Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
 
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
   // Creating nodes
   NodeContainer nodes;
-  nodes.Create (3);
+  nodes.Create(3);
 
   // Connecting nodes using two links
   PointToPointHelper p2p;
-  p2p.Install (nodes.Get (0), nodes.Get (1));
-  p2p.Install (nodes.Get (1), nodes.Get (2));
+  p2p.Install(nodes.Get(0), nodes.Get(1));
+  p2p.Install(nodes.Get(1), nodes.Get(2));
 
   // Install CCNx stack on all nodes
   ndn::StackHelper ccnxHelper;
-  ccnxHelper.SetDefaultRoutes (true);
+  ccnxHelper.SetDefaultRoutes(true);
 
   // node 0: disable cache completely
-  ccnxHelper.SetContentStore ("ns3::ndn::cs::Nocache"); // disable cache
-  ccnxHelper.Install (nodes.Get (0));
+  ccnxHelper.SetContentStore("ns3::ndn::cs::Nocache"); // disable cache
+  ccnxHelper.Install(nodes.Get(0));
 
   // node 1 and 2: set cache with Lfu policy
-  ccnxHelper.SetContentStore ("ns3::ndn::cs::Freshness::Lfu", "MaxSize", "2"); // can set cache size this way
-  ccnxHelper.Install (nodes.Get (1));
-  ccnxHelper.Install (nodes.Get (2));
+  ccnxHelper.SetContentStore("ns3::ndn::cs::Freshness::Lfu", "MaxSize",
+                             "2"); // can set cache size this way
+  ccnxHelper.Install(nodes.Get(1));
+  ccnxHelper.Install(nodes.Get(2));
 
   // alternative way to configure cache size
   // [number after nodeList is global ID of the node (= node->GetId ())]
-  Config::Set ("/NodeList/2/$ns3::ndn::ContentStore/MaxSize", UintegerValue (100000));
+  Config::Set("/NodeList/2/$ns3::ndn::ContentStore/MaxSize", UintegerValue(100000));
 
   // Installing applications
 
   // Consumer
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
   // Consumer will request /prefix/0, /prefix/1, ...
-  consumerHelper.SetPrefix ("/prefix");
-  consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
-  consumerHelper.Install (nodes.Get (0)); // first node
+  consumerHelper.SetPrefix("/prefix");
+  consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
+  consumerHelper.Install(nodes.Get(0));                        // first node
 
   // Producer
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
   // Producer will reply to all requests starting with /prefix
-  producerHelper.SetPrefix ("/prefix");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
-  producerHelper.Install (nodes.Get (2)); // last node
+  producerHelper.SetPrefix("/prefix");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+  producerHelper.Install(nodes.Get(2)); // last node
 
-  Simulator::Stop (Seconds (200000.0));
+  Simulator::Stop(Seconds(200000.0));
 
   struct ::timeval t;
   gettimeofday(&t, NULL);
   double beginRealTime = t.tv_sec + (0.000001 * (unsigned)t.tv_usec);
-  Simulator::Schedule (Seconds (0), PrintCsMemStatsHeader, boost::ref (std::cout));
-  Simulator::Schedule (Seconds (100), PrintCsMemStats, boost::ref (std::cout), Seconds (100), beginRealTime);
+  Simulator::Schedule(Seconds(0), PrintCsMemStatsHeader, boost::ref(std::cout));
+  Simulator::Schedule(Seconds(100), PrintCsMemStats, boost::ref(std::cout), Seconds(100),
+                      beginRealTime);
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-simple-with-custom-app.cpp b/examples/ndn-simple-with-custom-app.cpp
index 2c9d1b9..c10ceaa 100644
--- a/examples/ndn-simple-with-custom-app.cpp
+++ b/examples/ndn-simple-with-custom-app.cpp
@@ -29,41 +29,43 @@
 /**
  * This scenario simulates a one-node two-app scenario:
  *
- *      +------+ <-----> (CustomApp1) 
- *      | Node | 
+ *      +------+ <-----> (CustomApp1)
+ *      | Node |
  *      +------+ <-----> (CustomApp2)
  *
  *     NS_LOG=CustomApp ./waf --run=ndn-simple-with-custom-app
  */
 
-int 
-main (int argc, char *argv[])
+int
+main(int argc, char* argv[])
 {
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
   // Creating nodes
-  Ptr<Node> node = CreateObject<Node> ();
+  Ptr<Node> node = CreateObject<Node>();
 
   // Install CCNx stack on all nodes
   ndn::StackHelper ccnxHelper;
-  ccnxHelper.InstallAll ();
+  ccnxHelper.InstallAll();
 
   // Installing applications
 
   // Consumer
-  ndn::AppHelper consumerHelper ("CustomApp");
-  ApplicationContainer app1 = consumerHelper.Install (node); 
-  ApplicationContainer app2 = consumerHelper.Install (node);
+  ndn::AppHelper consumerHelper("CustomApp");
+  ApplicationContainer app1 = consumerHelper.Install(node);
+  ApplicationContainer app2 = consumerHelper.Install(node);
 
-  app1.Start (Seconds (1.0)); // will send out Interest, which nobody will receive (Interests generated by an app will not got back to the app)
-  app2.Start (Seconds (2.0)); // will send out an Interests, which will be received and satisfied by app1
-  
-  Simulator::Stop (Seconds (3.0));
+  app1.Start(Seconds(1.0)); // will send out Interest, which nobody will receive (Interests
+                            // generated by an app will not got back to the app)
+  app2.Start(
+    Seconds(2.0)); // will send out an Interests, which will be received and satisfied by app1
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Stop(Seconds(3.0));
+
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-simple-with-link-failure.cpp b/examples/ndn-simple-with-link-failure.cpp
index c96103d..c020a36 100644
--- a/examples/ndn-simple-with-link-failure.cpp
+++ b/examples/ndn-simple-with-link-failure.cpp
@@ -49,56 +49,56 @@
  *     NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-simple
  */
 
-int 
-main (int argc, char *argv[])
+int
+main(int argc, char* argv[])
 {
   // setting default parameters for PointToPoint links and channels
-  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
-  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
-  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
+  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
+  Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
 
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
   // Creating nodes
   NodeContainer nodes;
-  nodes.Create (3);
+  nodes.Create(3);
 
   // Connecting nodes using two links
   PointToPointHelper p2p;
-  p2p.Install (nodes.Get (0), nodes.Get (1));
-  p2p.Install (nodes.Get (1), nodes.Get (2));
+  p2p.Install(nodes.Get(0), nodes.Get(1));
+  p2p.Install(nodes.Get(1), nodes.Get(2));
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetDefaultRoutes (true);
-  ndnHelper.InstallAll ();
+  ndnHelper.SetDefaultRoutes(true);
+  ndnHelper.InstallAll();
 
   // Installing applications
 
   // Consumer
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
   // Consumer will request /prefix/0, /prefix/1, ...
-  consumerHelper.SetPrefix ("/prefix");
-  consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
-  consumerHelper.Install (nodes.Get (0)); // first node
+  consumerHelper.SetPrefix("/prefix");
+  consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
+  consumerHelper.Install(nodes.Get(0));                        // first node
 
   // Producer
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
   // Producer will reply to all requests starting with /prefix
-  producerHelper.SetPrefix ("/prefix");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
-  producerHelper.Install (nodes.Get (2)); // last node
+  producerHelper.SetPrefix("/prefix");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+  producerHelper.Install(nodes.Get(2)); // last node
 
   // The failure of the link connecting consumer and router will start from seconds 10.0 to 15.0
-  Simulator::Schedule (Seconds (10.0), ndn::LinkControlHelper::FailLink, nodes.Get (0), nodes.Get (1));
-  Simulator::Schedule (Seconds (15.0), ndn::LinkControlHelper::UpLink,   nodes.Get (0), nodes.Get (1));   
-  
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Schedule(Seconds(10.0), ndn::LinkControlHelper::FailLink, nodes.Get(0), nodes.Get(1));
+  Simulator::Schedule(Seconds(15.0), ndn::LinkControlHelper::UpLink, nodes.Get(0), nodes.Get(1));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Stop(Seconds(20.0));
+
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-simple-with-pcap.cpp b/examples/ndn-simple-with-pcap.cpp
index 1e35fb0..ecbc8eb 100644
--- a/examples/ndn-simple-with-pcap.cpp
+++ b/examples/ndn-simple-with-pcap.cpp
@@ -25,84 +25,81 @@
 
 using namespace ns3;
 
-class PcapWriter
-{
+class PcapWriter {
 public:
-  PcapWriter (const std::string &file)
+  PcapWriter(const std::string& file)
   {
     PcapHelper helper;
-    m_pcap = helper.CreateFile (file, std::ios::out, PcapHelper::DLT_PPP);
+    m_pcap = helper.CreateFile(file, std::ios::out, PcapHelper::DLT_PPP);
   }
 
   void
-  TracePacket (Ptr<const Packet> packet)
+  TracePacket(Ptr<const Packet> packet)
   {
     static PppHeader pppHeader;
-    pppHeader.SetProtocol (0x0077);
+    pppHeader.SetProtocol(0x0077);
 
-    m_pcap->Write (Simulator::Now (), pppHeader, packet);
+    m_pcap->Write(Simulator::Now(), pppHeader, packet);
   }
 
 private:
   Ptr<PcapFileWrapper> m_pcap;
 };
 
-
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   // setting default parameters for PointToPoint links and channels
-  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
-  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
-  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
+  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
+  Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
 
-  Config::SetGlobal ("ndn::WireFormat", StringValue ("1"));
+  Config::SetGlobal("ndn::WireFormat", StringValue("1"));
 
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
-  
+  cmd.Parse(argc, argv);
+
   // Creating nodes
   NodeContainer nodes;
-  nodes.Create (3);
+  nodes.Create(3);
 
   // Connecting nodes using two links
   PointToPointHelper p2p;
-  p2p.Install (nodes.Get (0), nodes.Get (1));
-  p2p.Install (nodes.Get (1), nodes.Get (2));
+  p2p.Install(nodes.Get(0), nodes.Get(1));
+  p2p.Install(nodes.Get(1), nodes.Get(2));
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetDefaultRoutes (true);
-  ndnHelper.InstallAll ();
+  ndnHelper.SetDefaultRoutes(true);
+  ndnHelper.InstallAll();
 
   // Installing applications
 
   // Consumer
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
   // Consumer will request /prefix/0, /prefix/1, ...
-  consumerHelper.SetPrefix ("/prefix");
-  consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
-  consumerHelper.Install (nodes.Get (0)); // first node
+  consumerHelper.SetPrefix("/prefix");
+  consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
+  consumerHelper.Install(nodes.Get(0));                        // first node
 
   // Producer
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
   // Producer will reply to all requests starting with /prefix
-  producerHelper.SetPrefix ("/prefix");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
-  producerHelper.SetAttribute ("Signature", UintegerValue (100));
-  producerHelper.SetAttribute ("KeyLocator", StringValue ("/unique/key/locator"));
-  producerHelper.Install (nodes.Get (2)); // last node
+  producerHelper.SetPrefix("/prefix");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+  producerHelper.SetAttribute("Signature", UintegerValue(100));
+  producerHelper.SetAttribute("KeyLocator", StringValue("/unique/key/locator"));
+  producerHelper.Install(nodes.Get(2)); // last node
 
-  PcapWriter trace ("ndn-simple-trace.pcap");
-  Config::ConnectWithoutContext ("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/MacTx",
-				 MakeCallback (&PcapWriter::TracePacket, &trace));
+  PcapWriter trace("ndn-simple-trace.pcap");
+  Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/MacTx",
+                                MakeCallback(&PcapWriter::TracePacket, &trace));
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
-
diff --git a/examples/ndn-simple.cpp b/examples/ndn-simple.cpp
index dea70a0..b7755e8 100644
--- a/examples/ndn-simple.cpp
+++ b/examples/ndn-simple.cpp
@@ -45,52 +45,52 @@
  *     NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-simple
  */
 
-int 
-main (int argc, char *argv[])
+int
+main(int argc, char* argv[])
 {
   // setting default parameters for PointToPoint links and channels
-  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
-  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
-  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
+  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
+  Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
 
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
   // Creating nodes
   NodeContainer nodes;
-  nodes.Create (3);
+  nodes.Create(3);
 
   // Connecting nodes using two links
   PointToPointHelper p2p;
-  p2p.Install (nodes.Get (0), nodes.Get (1));
-  p2p.Install (nodes.Get (1), nodes.Get (2));
+  p2p.Install(nodes.Get(0), nodes.Get(1));
+  p2p.Install(nodes.Get(1), nodes.Get(2));
 
   // Install NDN stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetDefaultRoutes (true);
-  ndnHelper.InstallAll ();
+  ndnHelper.SetDefaultRoutes(true);
+  ndnHelper.InstallAll();
 
   // Installing applications
 
   // Consumer
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
   // Consumer will request /prefix/0, /prefix/1, ...
-  consumerHelper.SetPrefix ("/prefix");
-  consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
-  consumerHelper.Install (nodes.Get (0)); // first node
+  consumerHelper.SetPrefix("/prefix");
+  consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
+  consumerHelper.Install(nodes.Get(0));                        // first node
 
   // Producer
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
   // Producer will reply to all requests starting with /prefix
-  producerHelper.SetPrefix ("/prefix");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
-  producerHelper.Install (nodes.Get (2)); // last node
+  producerHelper.SetPrefix("/prefix");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+  producerHelper.Install(nodes.Get(2)); // last node
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-tree-app-delay-tracer.cpp b/examples/ndn-tree-app-delay-tracer.cpp
index b4563a9..b503843 100644
--- a/examples/ndn-tree-app-delay-tracer.cpp
+++ b/examples/ndn-tree-app-delay-tracer.cpp
@@ -32,21 +32,21 @@
  *    /------\      /------\      /------\      /------\
  *    |leaf-1|      |leaf-2|      |leaf-3|      |leaf-4|
  *    \------/      \------/      \------/      \------/
- *         ^          ^                ^           ^	
+ *         ^          ^                ^           ^
  *         |          |                |           |
- *    	    \        /                  \         / 
+ *    	    \        /                  \         /
  *           \      /  			 \  	 /    10Mbps / 1ms
  *            \    /  			  \ 	/
- *             |  |  			   |   | 
- *    	       v  v                        v   v     
+ *             |  |  			   |   |
+ *    	       v  v                        v   v
  *          /-------\                    /-------\
  *          | rtr-1 |                    | rtr-2 |
  *          \-------/                    \-------/
- *                ^                        ^                      
+ *                ^                        ^
  *      	  |	 		   |
- *      	   \			  /  10 Mpbs / 1ms 
- *      	    +--------+  +--------+ 
- *      		     |  |      
+ *      	   \			  /  10 Mpbs / 1ms
+ *      	    +--------+  +--------+
+ *      		     |  |
  *                           v  v
  *      		  /--------\
  *      		  |  root  |
@@ -59,59 +59,58 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
-  AnnotatedTopologyReader topologyReader ("", 1);
-  topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-tree.txt");
-  topologyReader.Read ();
+  AnnotatedTopologyReader topologyReader("", 1);
+  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-tree.txt");
+  topologyReader.Read();
 
   // Install CCNx stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ndnHelper.InstallAll ();
+  ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ndnHelper.InstallAll();
 
   // Installing global routing interface on all nodes
   ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
-  ccnxGlobalRoutingHelper.InstallAll ();
+  ccnxGlobalRoutingHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> consumers[4] = { Names::Find<Node> ("leaf-1"), Names::Find<Node> ("leaf-2"),
-                             Names::Find<Node> ("leaf-3"), Names::Find<Node> ("leaf-4") };
-  Ptr<Node> producer = Names::Find<Node> ("root");
-  
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerBatches");
-  consumerHelper.SetPrefix ("/root");
-  consumerHelper.SetAttribute ("Batches", StringValue ("1s 1 10s 1"));
-  consumerHelper.Install (consumers[0]);
+  Ptr<Node> consumers[4] = {Names::Find<Node>("leaf-1"), Names::Find<Node>("leaf-2"),
+                            Names::Find<Node>("leaf-3"), Names::Find<Node>("leaf-4")};
+  Ptr<Node> producer = Names::Find<Node>("root");
 
-  consumerHelper.SetAttribute ("Batches", StringValue ("11s 1")); 
-  consumerHelper.Install (consumers[1]);
-  
-  consumerHelper.SetAttribute ("Batches", StringValue ("11s 1")); 
-  consumerHelper.Install (consumers[2]);
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerBatches");
+  consumerHelper.SetPrefix("/root");
+  consumerHelper.SetAttribute("Batches", StringValue("1s 1 10s 1"));
+  consumerHelper.Install(consumers[0]);
 
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));  
+  consumerHelper.SetAttribute("Batches", StringValue("11s 1"));
+  consumerHelper.Install(consumers[1]);
+
+  consumerHelper.SetAttribute("Batches", StringValue("11s 1"));
+  consumerHelper.Install(consumers[2]);
+
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
 
   // Register /root prefix with global routing controller and
   // install producer that will satisfy Interests in /root namespace
-  ccnxGlobalRoutingHelper.AddOrigins ("/root", producer);
-  producerHelper.SetPrefix ("/root");
-  producerHelper.Install (producer)
-    .Start (Seconds (9));
+  ccnxGlobalRoutingHelper.AddOrigins("/root", producer);
+  producerHelper.SetPrefix("/root");
+  producerHelper.Install(producer).Start(Seconds(9));
 
   // Calculate and install FIBs
-  ccnxGlobalRoutingHelper.CalculateRoutes ();
+  ccnxGlobalRoutingHelper.CalculateRoutes();
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  ndn::AppDelayTracer::InstallAll ("app-delays-trace.txt");
-  
-  Simulator::Run ();
-  Simulator::Destroy ();
+  ndn::AppDelayTracer::InstallAll("app-delays-trace.txt");
+
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-tree-cs-tracers.cpp b/examples/ndn-tree-cs-tracers.cpp
index eaa5bf9..ce27888 100644
--- a/examples/ndn-tree-cs-tracers.cpp
+++ b/examples/ndn-tree-cs-tracers.cpp
@@ -32,21 +32,21 @@
  *    /------\      /------\      /------\      /------\
  *    |leaf-1|      |leaf-2|      |leaf-3|      |leaf-4|
  *    \------/      \------/      \------/      \------/
- *         ^          ^                ^           ^	
+ *         ^          ^                ^           ^
  *         |          |                |           |
- *    	    \        /                  \         / 
+ *    	    \        /                  \         /
  *           \      /  			 \  	 /    10Mbps / 1ms
  *            \    /  			  \ 	/
- *             |  |  			   |   | 
- *    	       v  v                        v   v     
+ *             |  |  			   |   |
+ *    	       v  v                        v   v
  *          /-------\                    /-------\
  *          | rtr-1 |                    | rtr-2 |
  *          \-------/                    \-------/
- *                ^                        ^                      
+ *                ^                        ^
  *      	  |	 		   |
- *      	   \			  /  10 Mpbs / 1ms 
- *      	    +--------+  +--------+ 
- *      		     |  |      
+ *      	   \			  /  10 Mpbs / 1ms
+ *      	    +--------+  +--------+
+ *      		     |  |
  *                           v  v
  *      		  /--------\
  *      		  |  root  |
@@ -59,59 +59,59 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
-  AnnotatedTopologyReader topologyReader ("", 1);
-  topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-tree.txt");
-  topologyReader.Read ();
+  AnnotatedTopologyReader topologyReader("", 1);
+  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-tree.txt");
+  topologyReader.Read();
 
   // Install CCNx stack on all nodes
   ndn::StackHelper ndnHelper;
-  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ndnHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "100"); // default ContentStore parameters
-  ndnHelper.InstallAll ();
+  ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize",
+                            "100"); // default ContentStore parameters
+  ndnHelper.InstallAll();
 
   // Installing global routing interface on all nodes
   ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
-  ccnxGlobalRoutingHelper.InstallAll ();
+  ccnxGlobalRoutingHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> consumers[4] = { Names::Find<Node> ("leaf-1"), Names::Find<Node> ("leaf-2"),
-                             Names::Find<Node> ("leaf-3"), Names::Find<Node> ("leaf-4") };
-  Ptr<Node> producer = Names::Find<Node> ("root");
+  Ptr<Node> consumers[4] = {Names::Find<Node>("leaf-1"), Names::Find<Node>("leaf-2"),
+                            Names::Find<Node>("leaf-3"), Names::Find<Node>("leaf-4")};
+  Ptr<Node> producer = Names::Find<Node>("root");
 
-  for (int i = 0; i < 4; i++)
-    {
-      ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-      consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 100 interests a second
+  for (int i = 0; i < 4; i++) {
+    ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+    consumerHelper.SetAttribute("Frequency", StringValue("10")); // 100 interests a second
 
-      // Each consumer will express the same data /root/<seq-no>
-      consumerHelper.SetPrefix ("/root");
-      ApplicationContainer app = consumerHelper.Install (consumers[i]);
-      app.Start (Seconds (0.01 * i));
-    }
-    
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));  
+    // Each consumer will express the same data /root/<seq-no>
+    consumerHelper.SetPrefix("/root");
+    ApplicationContainer app = consumerHelper.Install(consumers[i]);
+    app.Start(Seconds(0.01 * i));
+  }
+
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
 
   // Register /root prefix with global routing controller and
   // install producer that will satisfy Interests in /root namespace
-  ccnxGlobalRoutingHelper.AddOrigins ("/root", producer);
-  producerHelper.SetPrefix ("/root");
-  producerHelper.Install (producer);
+  ccnxGlobalRoutingHelper.AddOrigins("/root", producer);
+  producerHelper.SetPrefix("/root");
+  producerHelper.Install(producer);
 
   // Calculate and install FIBs
-  ccnxGlobalRoutingHelper.CalculateRoutes ();
+  ccnxGlobalRoutingHelper.CalculateRoutes();
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  ndn::CsTracer::InstallAll ("cs-trace.txt", Seconds (1));
-  
-  Simulator::Run ();
-  Simulator::Destroy ();
+  ndn::CsTracer::InstallAll("cs-trace.txt", Seconds(1));
+
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-tree-tracers.cpp b/examples/ndn-tree-tracers.cpp
index aeb65f9..29772f7 100644
--- a/examples/ndn-tree-tracers.cpp
+++ b/examples/ndn-tree-tracers.cpp
@@ -32,21 +32,21 @@
  *    /------\      /------\      /------\      /------\
  *    |leaf-1|      |leaf-2|      |leaf-3|      |leaf-4|
  *    \------/      \------/      \------/      \------/
- *         ^          ^                ^           ^	
+ *         ^          ^                ^           ^
  *         |          |                |           |
- *    	    \        /                  \         / 
+ *    	    \        /                  \         /
  *           \      /  			 \  	 /    10Mbps / 1ms
  *            \    /  			  \ 	/
- *             |  |  			   |   | 
- *    	       v  v                        v   v     
+ *             |  |  			   |   |
+ *    	       v  v                        v   v
  *          /-------\                    /-------\
  *          | rtr-1 |                    | rtr-2 |
  *          \-------/                    \-------/
- *                ^                        ^                      
+ *                ^                        ^
  *      	  |	 		   |
- *      	   \			  /  10 Mpbs / 1ms 
- *      	    +--------+  +--------+ 
- *      		     |  |      
+ *      	   \			  /  10 Mpbs / 1ms
+ *      	    +--------+  +--------+
+ *      		     |  |
  *                           v  v
  *      		  /--------\
  *      		  |  root  |
@@ -59,58 +59,57 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
-  AnnotatedTopologyReader topologyReader ("", 1);
-  topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-tree.txt");
-  topologyReader.Read ();
+  AnnotatedTopologyReader topologyReader("", 1);
+  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-tree.txt");
+  topologyReader.Read();
 
   // Install CCNx stack on all nodes
   ndn::StackHelper ccnxHelper;
-  ccnxHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ccnxHelper.InstallAll ();
+  ccnxHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ccnxHelper.InstallAll();
 
   // Installing global routing interface on all nodes
   ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
-  ccnxGlobalRoutingHelper.InstallAll ();
+  ccnxGlobalRoutingHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> consumers[4] = { Names::Find<Node> ("leaf-1"), Names::Find<Node> ("leaf-2"),
-                             Names::Find<Node> ("leaf-3"), Names::Find<Node> ("leaf-4") };
-  Ptr<Node> producer = Names::Find<Node> ("root");
+  Ptr<Node> consumers[4] = {Names::Find<Node>("leaf-1"), Names::Find<Node>("leaf-2"),
+                            Names::Find<Node>("leaf-3"), Names::Find<Node>("leaf-4")};
+  Ptr<Node> producer = Names::Find<Node>("root");
 
-  for (int i = 0; i < 4; i++)
-    {
-      ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-      consumerHelper.SetAttribute ("Frequency", StringValue ("100")); // 100 interests a second
+  for (int i = 0; i < 4; i++) {
+    ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+    consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
 
-      // Each consumer will express unique interests /root/<leaf-name>/<seq-no>
-      consumerHelper.SetPrefix ("/root/" + Names::FindName (consumers[i]));
-      consumerHelper.Install (consumers[i]);
-    }
-    
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));  
+    // Each consumer will express unique interests /root/<leaf-name>/<seq-no>
+    consumerHelper.SetPrefix("/root/" + Names::FindName(consumers[i]));
+    consumerHelper.Install(consumers[i]);
+  }
+
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
 
   // Register /root prefix with global routing controller and
   // install producer that will satisfy Interests in /root namespace
-  ccnxGlobalRoutingHelper.AddOrigins ("/root", producer);
-  producerHelper.SetPrefix ("/root");
-  producerHelper.Install (producer);
+  ccnxGlobalRoutingHelper.AddOrigins("/root", producer);
+  producerHelper.SetPrefix("/root");
+  producerHelper.Install(producer);
 
   // Calculate and install FIBs
-  ccnxGlobalRoutingHelper.CalculateRoutes ();
+  ccnxGlobalRoutingHelper.CalculateRoutes();
 
-  Simulator::Stop (Seconds (20.0));
+  Simulator::Stop(Seconds(20.0));
 
-  ndn::L3AggregateTracer::InstallAll ("aggregate-trace.txt", Seconds (0.5));
-  ndn::L3RateTracer::InstallAll ("rate-trace.txt", Seconds (0.5));
-  
-  Simulator::Run ();
-  Simulator::Destroy ();
+  ndn::L3AggregateTracer::InstallAll("aggregate-trace.txt", Seconds(0.5));
+  ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.5));
+
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-tree-with-l2tracer.cpp b/examples/ndn-tree-with-l2tracer.cpp
index 19ba3a2..8d5e3e0 100644
--- a/examples/ndn-tree-with-l2tracer.cpp
+++ b/examples/ndn-tree-with-l2tracer.cpp
@@ -7,135 +7,135 @@
 using namespace ns3;
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
-  AnnotatedTopologyReader topologyReader ("", 10);
-  topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-tree-25-node.txt");
-  topologyReader.Read ();
-  
+  AnnotatedTopologyReader topologyReader("", 10);
+  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-tree-25-node.txt");
+  topologyReader.Read();
+
   /****************************************************************************/
   // Install CCNx stack on all nodes
   ndn::StackHelper ccnxHelper;
-  ccnxHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "1000");
-  ccnxHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
-  ccnxHelper.InstallAll ();
+  ccnxHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000");
+  ccnxHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+  ccnxHelper.InstallAll();
   /****************************************************************************/
   // Installing global routing interface on all nodes
   ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
-  ccnxGlobalRoutingHelper.InstallAll ();
+  ccnxGlobalRoutingHelper.InstallAll();
   /****************************************************************************/
   // Getting containers for the consumer/producer
-  Ptr<Node> consumer1 = Names::Find<Node> ("Src1");
-  Ptr<Node> consumer2 = Names::Find<Node> ("Src2");
-  Ptr<Node> consumer3 = Names::Find<Node> ("Src3");
-  Ptr<Node> consumer4 = Names::Find<Node> ("Src4");
-  Ptr<Node> consumer5 = Names::Find<Node> ("Src5");
-  Ptr<Node> consumer6 = Names::Find<Node> ("Src6");
-  Ptr<Node> consumer7 = Names::Find<Node> ("Src7");
-  Ptr<Node> consumer8 = Names::Find<Node> ("Src8");
-  Ptr<Node> consumer9 = Names::Find<Node> ("Src9");
+  Ptr<Node> consumer1 = Names::Find<Node>("Src1");
+  Ptr<Node> consumer2 = Names::Find<Node>("Src2");
+  Ptr<Node> consumer3 = Names::Find<Node>("Src3");
+  Ptr<Node> consumer4 = Names::Find<Node>("Src4");
+  Ptr<Node> consumer5 = Names::Find<Node>("Src5");
+  Ptr<Node> consumer6 = Names::Find<Node>("Src6");
+  Ptr<Node> consumer7 = Names::Find<Node>("Src7");
+  Ptr<Node> consumer8 = Names::Find<Node>("Src8");
+  Ptr<Node> consumer9 = Names::Find<Node>("Src9");
 
-  Ptr<Node> producer1 = Names::Find<Node> ("Dst1");
-  Ptr<Node> producer2 = Names::Find<Node> ("Dst2");
-  Ptr<Node> producer3 = Names::Find<Node> ("Dst3");
-  Ptr<Node> producer4 = Names::Find<Node> ("Dst4");
-  Ptr<Node> producer5 = Names::Find<Node> ("Dst5");
-  Ptr<Node> producer6 = Names::Find<Node> ("Dst6");
-  Ptr<Node> producer7 = Names::Find<Node> ("Dst7");
-  Ptr<Node> producer8 = Names::Find<Node> ("Dst8");
-  Ptr<Node> producer9 = Names::Find<Node> ("Dst9");
+  Ptr<Node> producer1 = Names::Find<Node>("Dst1");
+  Ptr<Node> producer2 = Names::Find<Node>("Dst2");
+  Ptr<Node> producer3 = Names::Find<Node>("Dst3");
+  Ptr<Node> producer4 = Names::Find<Node>("Dst4");
+  Ptr<Node> producer5 = Names::Find<Node>("Dst5");
+  Ptr<Node> producer6 = Names::Find<Node>("Dst6");
+  Ptr<Node> producer7 = Names::Find<Node>("Dst7");
+  Ptr<Node> producer8 = Names::Find<Node>("Dst8");
+  Ptr<Node> producer9 = Names::Find<Node>("Dst9");
   /****************************************************************************/
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-  consumerHelper.SetAttribute ("Frequency", StringValue ("1000"));//interests per Second
-  consumerHelper.SetAttribute ("Randomize", StringValue ("uniform"));
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+  consumerHelper.SetAttribute("Frequency", StringValue("1000")); // interests per Second
+  consumerHelper.SetAttribute("Randomize", StringValue("uniform"));
   /****************************************************************************/
   // on the first to ninth consumer node install a Consumer application
   // that will express interests in /dst1 to /dst9 namespace
-  consumerHelper.SetPrefix ("/dst9");
-  consumerHelper.Install (consumer1);
+  consumerHelper.SetPrefix("/dst9");
+  consumerHelper.Install(consumer1);
 
-  consumerHelper.SetPrefix ("/dst8");
-  consumerHelper.Install (consumer2);
+  consumerHelper.SetPrefix("/dst8");
+  consumerHelper.Install(consumer2);
 
-  consumerHelper.SetPrefix ("/dst7");
-  consumerHelper.Install (consumer3);
+  consumerHelper.SetPrefix("/dst7");
+  consumerHelper.Install(consumer3);
 
-  consumerHelper.SetPrefix ("/dst6");
-  consumerHelper.Install (consumer4);
+  consumerHelper.SetPrefix("/dst6");
+  consumerHelper.Install(consumer4);
 
-  consumerHelper.SetPrefix ("/dst5");
-  consumerHelper.Install (consumer5);
+  consumerHelper.SetPrefix("/dst5");
+  consumerHelper.Install(consumer5);
 
-  consumerHelper.SetPrefix ("/dst4");
-  consumerHelper.Install (consumer6);
+  consumerHelper.SetPrefix("/dst4");
+  consumerHelper.Install(consumer6);
 
-  consumerHelper.SetPrefix ("/dst3");
-  consumerHelper.Install (consumer7);
+  consumerHelper.SetPrefix("/dst3");
+  consumerHelper.Install(consumer7);
 
-  consumerHelper.SetPrefix ("/dst2");
-  consumerHelper.Install (consumer8);
+  consumerHelper.SetPrefix("/dst2");
+  consumerHelper.Install(consumer8);
 
-  consumerHelper.SetPrefix ("/dst1");
-  consumerHelper.Install (consumer9);
-  
+  consumerHelper.SetPrefix("/dst1");
+  consumerHelper.Install(consumer9);
+
   /****************************************************************************/
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
   /****************************************************************************/
   // Register /dst1 to /dst9 prefix with global routing controller and
   // install producer that will satisfy Interests in /dst1 to /dst9 namespace
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst1", producer1);
-  producerHelper.SetPrefix ("/dst1");
-  producerHelper.Install (producer1);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst1", producer1);
+  producerHelper.SetPrefix("/dst1");
+  producerHelper.Install(producer1);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst2", producer2);
-  producerHelper.SetPrefix ("/dst2");
-  producerHelper.Install (producer2);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst2", producer2);
+  producerHelper.SetPrefix("/dst2");
+  producerHelper.Install(producer2);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst3", producer3);
-  producerHelper.SetPrefix ("/dst3");
-  producerHelper.Install (producer3);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst3", producer3);
+  producerHelper.SetPrefix("/dst3");
+  producerHelper.Install(producer3);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst4", producer4);
-  producerHelper.SetPrefix ("/dst4");
-  producerHelper.Install (producer4);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst4", producer4);
+  producerHelper.SetPrefix("/dst4");
+  producerHelper.Install(producer4);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst5", producer5);
-  producerHelper.SetPrefix ("/dst5");
-  producerHelper.Install (producer5);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst5", producer5);
+  producerHelper.SetPrefix("/dst5");
+  producerHelper.Install(producer5);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst6", producer6);
-  producerHelper.SetPrefix ("/dst6");
-  producerHelper.Install (producer6);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst6", producer6);
+  producerHelper.SetPrefix("/dst6");
+  producerHelper.Install(producer6);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst7", producer7);
-  producerHelper.SetPrefix ("/dst7");
-  producerHelper.Install (producer7);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst7", producer7);
+  producerHelper.SetPrefix("/dst7");
+  producerHelper.Install(producer7);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst8", producer8);
-  producerHelper.SetPrefix ("/dst8");
-  producerHelper.Install (producer8);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst8", producer8);
+  producerHelper.SetPrefix("/dst8");
+  producerHelper.Install(producer8);
 
-  ccnxGlobalRoutingHelper.AddOrigins ("/dst9", producer9);
-  producerHelper.SetPrefix ("/dst9");
-  producerHelper.Install (producer9);
+  ccnxGlobalRoutingHelper.AddOrigins("/dst9", producer9);
+  producerHelper.SetPrefix("/dst9");
+  producerHelper.Install(producer9);
 
   /*****************************************************************************/
   // Calculate and install FIBs
-  ccnxGlobalRoutingHelper.CalculateRoutes ();
+  ccnxGlobalRoutingHelper.CalculateRoutes();
 
-  Simulator::Stop (Seconds (10.0));
+  Simulator::Stop(Seconds(10.0));
 
   /****************************************************************************/
-  //Tracer:
+  // Tracer:
 
-  L2RateTracer::InstallAll ("drop-trace.txt", Seconds (0.5));
+  L2RateTracer::InstallAll("drop-trace.txt", Seconds(0.5));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
diff --git a/examples/ndn-zipf-mandelbrot.cpp b/examples/ndn-zipf-mandelbrot.cpp
index 64e385c..4bec18e 100644
--- a/examples/ndn-zipf-mandelbrot.cpp
+++ b/examples/ndn-zipf-mandelbrot.cpp
@@ -51,63 +51,63 @@
  */
 
 int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
 {
-  //LogComponentEnable("ndn.CbisGlobalRoutingHelper", LOG_LEVEL_INFO);
+  // LogComponentEnable("ndn.CbisGlobalRoutingHelper", LOG_LEVEL_INFO);
   // Setting default parameters for PointToPoint links and channels
-  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
-  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("1ms"));
-  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("10"));
+  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
+  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("1ms"));
+  Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("10"));
 
   // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
   CommandLine cmd;
-  cmd.Parse (argc, argv);
+  cmd.Parse(argc, argv);
 
   // Creating 3x3 topology
   PointToPointHelper p2p;
-  PointToPointGridHelper grid (3, 3, p2p);
-  grid.BoundingBox(100,100,200,200);
+  PointToPointGridHelper grid(3, 3, p2p);
+  grid.BoundingBox(100, 100, 200, 200);
 
   // Install CCNx stack on all nodes
   ndn::StackHelper ccnxHelper;
-  ccnxHelper.SetForwardingStrategy ("ns3::ndn::fw::SmartFlooding");
-  ccnxHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "10");
-  ccnxHelper.InstallAll ();
+  ccnxHelper.SetForwardingStrategy("ns3::ndn::fw::SmartFlooding");
+  ccnxHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "10");
+  ccnxHelper.InstallAll();
 
   // Installing global routing interface on all nodes
-  //ndn::CbisGlobalRoutingHelper ccnxGlobalRoutingHelper;
+  // ndn::CbisGlobalRoutingHelper ccnxGlobalRoutingHelper;
   ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
-  ccnxGlobalRoutingHelper.InstallAll ();
+  ccnxGlobalRoutingHelper.InstallAll();
 
   // Getting containers for the consumer/producer
-  Ptr<Node> producer = grid.GetNode (2, 2);
+  Ptr<Node> producer = grid.GetNode(2, 2);
   NodeContainer consumerNodes;
-  consumerNodes.Add (grid.GetNode (0,0));
+  consumerNodes.Add(grid.GetNode(0, 0));
 
   // Install CCNx applications
   std::string prefix = "/prefix";
 
-  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerZipfMandelbrot");
-  //ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
-  consumerHelper.SetPrefix (prefix);
-  consumerHelper.SetAttribute ("Frequency", StringValue ("100")); // 100 interests a second
-  consumerHelper.SetAttribute ("NumberOfContents", StringValue ("100")); // 10 different contents
-  //consumerHelper.SetAttribute ("Randomize", StringValue ("uniform")); // 100 interests a second
-  consumerHelper.Install (consumerNodes);
+  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerZipfMandelbrot");
+  // ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
+  consumerHelper.SetPrefix(prefix);
+  consumerHelper.SetAttribute("Frequency", StringValue("100"));        // 100 interests a second
+  consumerHelper.SetAttribute("NumberOfContents", StringValue("100")); // 10 different contents
+  // consumerHelper.SetAttribute ("Randomize", StringValue ("uniform")); // 100 interests a second
+  consumerHelper.Install(consumerNodes);
 
-  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
-  producerHelper.SetPrefix (prefix);
-  producerHelper.SetAttribute ("PayloadSize", StringValue("100"));
-  producerHelper.Install (producer);
-  ccnxGlobalRoutingHelper.AddOrigins (prefix, producer);
+  ndn::AppHelper producerHelper("ns3::ndn::Producer");
+  producerHelper.SetPrefix(prefix);
+  producerHelper.SetAttribute("PayloadSize", StringValue("100"));
+  producerHelper.Install(producer);
+  ccnxGlobalRoutingHelper.AddOrigins(prefix, producer);
 
   // Calculate and install FIBs
-  ccnxGlobalRoutingHelper.CalculateRoutes ();
+  ccnxGlobalRoutingHelper.CalculateRoutes();
 
-  Simulator::Stop (Seconds (10.0));
+  Simulator::Stop(Seconds(10.0));
 
-  Simulator::Run ();
-  Simulator::Destroy ();
+  Simulator::Run();
+  Simulator::Destroy();
 
   return 0;
 }
