diff --git a/daemon/fw/algorithm.cpp b/daemon/fw/algorithm.cpp
index 1ed699b..7dada21 100644
--- a/daemon/fw/algorithm.cpp
+++ b/daemon/fw/algorithm.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -75,7 +75,7 @@
 }
 
 int
-findDuplicateNonce(const pit::Entry& pitEntry, uint32_t nonce, const Face& face)
+findDuplicateNonce(const pit::Entry& pitEntry, Interest::Nonce nonce, const Face& face)
 {
   int dnw = DUPLICATE_NONCE_NONE;
 
diff --git a/daemon/fw/algorithm.hpp b/daemon/fw/algorithm.hpp
index 07a0e01..68d9f14 100644
--- a/daemon/fw/algorithm.hpp
+++ b/daemon/fw/algorithm.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -70,7 +70,7 @@
  *  \return OR'ed DuplicateNonceWhere
  */
 int
-findDuplicateNonce(const pit::Entry& pitEntry, uint32_t nonce, const Face& face);
+findDuplicateNonce(const pit::Entry& pitEntry, Interest::Nonce nonce, const Face& face);
 
 /** \brief determine whether \p pitEntry has any pending out-records
  *  \return true if there is at least one out-record waiting for Data
diff --git a/daemon/table/dead-nonce-list.cpp b/daemon/table/dead-nonce-list.cpp
index 3521b51..142ddea 100644
--- a/daemon/table/dead-nonce-list.cpp
+++ b/daemon/table/dead-nonce-list.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -87,14 +87,14 @@
 }
 
 bool
-DeadNonceList::has(const Name& name, uint32_t nonce) const
+DeadNonceList::has(const Name& name, Interest::Nonce nonce) const
 {
   Entry entry = DeadNonceList::makeEntry(name, nonce);
   return m_ht.find(entry) != m_ht.end();
 }
 
 void
-DeadNonceList::add(const Name& name, uint32_t nonce)
+DeadNonceList::add(const Name& name, Interest::Nonce nonce)
 {
   Entry entry = DeadNonceList::makeEntry(name, nonce);
   m_queue.push_back(entry);
@@ -103,11 +103,12 @@
 }
 
 DeadNonceList::Entry
-DeadNonceList::makeEntry(const Name& name, uint32_t nonce)
+DeadNonceList::makeEntry(const Name& name, Interest::Nonce nonce)
 {
   Block nameWire = name.wireEncode();
-  return CityHash64WithSeed(reinterpret_cast<const char*>(nameWire.wire()), nameWire.size(),
-                            static_cast<uint64_t>(nonce));
+  uint32_t n;
+  std::memcpy(&n, nonce.data(), sizeof(n));
+  return CityHash64WithSeed(reinterpret_cast<const char*>(nameWire.wire()), nameWire.size(), n);
 }
 
 size_t
diff --git a/daemon/table/dead-nonce-list.hpp b/daemon/table/dead-nonce-list.hpp
index dea1d51..5b49143 100644
--- a/daemon/table/dead-nonce-list.hpp
+++ b/daemon/table/dead-nonce-list.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -67,15 +67,15 @@
   ~DeadNonceList();
 
   /** \brief Determines if name+nonce exists
-   *  \return true if name+nonce exists
+   *  \return true if name+nonce exists, false otherwise
    */
   bool
-  has(const Name& name, uint32_t nonce) const;
+  has(const Name& name, Interest::Nonce nonce) const;
 
   /** \brief Records name+nonce
    */
   void
-  add(const Name& name, uint32_t nonce);
+  add(const Name& name, Interest::Nonce nonce);
 
   /** \return number of stored Nonces
    *  \note The return value does not contain non-Nonce entries in the index, if any.
@@ -95,7 +95,7 @@
   typedef uint64_t Entry;
 
   static Entry
-  makeEntry(const Name& name, uint32_t nonce);
+  makeEntry(const Name& name, Interest::Nonce nonce);
 
   typedef boost::multi_index_container<
     Entry,
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
index 7c36ab6..1a68a51 100644
--- a/daemon/table/pit-face-record.hpp
+++ b/daemon/table/pit-face-record.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -51,7 +51,7 @@
     return m_face;
   }
 
-  uint32_t
+  Interest::Nonce
   getLastNonce() const
   {
     return m_lastNonce;
@@ -79,7 +79,7 @@
 
 private:
   Face& m_face;
-  uint32_t m_lastNonce = 0;
+  Interest::Nonce m_lastNonce{0, 0, 0, 0};
   time::steady_clock::TimePoint m_lastRenewed = time::steady_clock::TimePoint::min();
   time::steady_clock::TimePoint m_expiry = time::steady_clock::TimePoint::min();
 };
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index 09013ee..14aa777 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -340,16 +340,14 @@
   topo.registerPrefix(nodeC, linkBC->getFace(nodeC), PRODUCER_PREFIX, 16);
   topo.registerPrefix(nodeB, linkBD->getFace(nodeB), PRODUCER_PREFIX, 80);
 
-  uint32_t nonce;
-
   // Send 6 interest since probes can be scheduled b/w 0-5 seconds
   for (int i = 1; i < 7; i++) {
     // Send ping number i
     Name name(PRODUCER_PREFIX);
     name.appendTimestamp();
-    shared_ptr<Interest> interest = makeInterest(name);
+    auto interest = makeInterest(name);
     ping->getClientFace().expressInterest(*interest, nullptr, nullptr, nullptr);
-    nonce = interest->getNonce();
+    auto nonce = interest->getNonce();
 
     // Don't know when the probe will be triggered since it is random between 0-5 seconds
     // or whether it will be triggered for this interest
@@ -360,13 +358,12 @@
     // Check if probe is sent to B else send another ping
     if (linkAB->getFace(nodeA).getCounters().nOutInterests == 1) {
       // Get pitEntry of node A
-      shared_ptr<pit::Entry> pitEntry = topo.getForwarder(nodeA).getPit().find(*interest);
-      //get outRecord associated with face towards B
-      pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkAB->getFace(nodeA));
+      auto pitEntry = topo.getForwarder(nodeA).getPit().find(*interest);
+      // Get outRecord associated with face towards B
+      auto outRecord = pitEntry->getOutRecord(linkAB->getFace(nodeA));
+      BOOST_REQUIRE(outRecord != pitEntry->out_end());
 
-      BOOST_CHECK(outRecord != pitEntry->out_end());
-
-      //Check that Nonce of interest is not equal to Nonce of Probe
+      // Check that Nonce of interest is not equal to Nonce of Probe
       BOOST_CHECK_NE(nonce, outRecord->getLastNonce());
 
       // B should not have received the probe interest yet
@@ -384,7 +381,6 @@
 
       // Get outRecord associated with face towards D.
       outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB));
-
       BOOST_CHECK(outRecord != pitEntry->out_end());
 
       // RTT between B and D
diff --git a/tests/daemon/table/dead-nonce-list.t.cpp b/tests/daemon/table/dead-nonce-list.t.cpp
index b98cd00..a5a537e 100644
--- a/tests/daemon/table/dead-nonce-list.t.cpp
+++ b/tests/daemon/table/dead-nonce-list.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -39,8 +39,8 @@
 {
   Name nameA("ndn:/A");
   Name nameB("ndn:/B");
-  const uint32_t nonce1 = 0x53b4eaa8;
-  const uint32_t nonce2 = 0x1f46372b;
+  const Interest::Nonce nonce1(0x53b4eaa8);
+  const Interest::Nonce nonce2(0x1f46372b);
 
   DeadNonceList dnl;
   BOOST_CHECK_EQUAL(dnl.size(), 0);
@@ -64,13 +64,8 @@
 protected:
   PeriodicalInsertionFixture()
     : dnl(LIFETIME)
-    , name("ndn:/N")
-    , lastNonce(0)
-    , addNonceBatch(0)
-    , addNonceInterval(LIFETIME / DeadNonceList::EXPECTED_MARK_COUNT)
-    , timeUnit(addNonceInterval / 2)
   {
-    this->addNonce();
+    addNonce();
   }
 
   void
@@ -86,7 +81,7 @@
       dnl.add(name, ++lastNonce);
     }
 
-    if (addNonceInterval > time::nanoseconds::zero()) {
+    if (addNonceInterval > 0_ns) {
       addNonceEvent = getScheduler().schedule(addNonceInterval, [this] { addNonce(); });
     }
   }
@@ -96,17 +91,17 @@
   void
   advanceClocksByLifetime(float t)
   {
-    this->advanceClocks(timeUnit, time::duration_cast<time::nanoseconds>(LIFETIME * t));
+    advanceClocks(timeUnit, time::duration_cast<time::nanoseconds>(LIFETIME * t));
   }
 
 protected:
   static const time::nanoseconds LIFETIME;
   DeadNonceList dnl;
-  Name name;
-  uint32_t lastNonce;
-  size_t addNonceBatch;
-  time::nanoseconds addNonceInterval;
-  time::nanoseconds timeUnit;
+  Name name = "/N";
+  uint32_t lastNonce = 0;
+  size_t addNonceBatch = 0;
+  const time::nanoseconds addNonceInterval = LIFETIME / DeadNonceList::EXPECTED_MARK_COUNT;
+  const time::nanoseconds timeUnit = addNonceInterval / 2;
   scheduler::ScopedEventId addNonceEvent;
 };
 
@@ -121,7 +116,7 @@
   this->advanceClocksByLifetime(10.0);
 
   Name nameC("ndn:/C");
-  const uint32_t nonceC = 0x25390656;
+  const Interest::Nonce nonceC(0x25390656);
   BOOST_CHECK_EQUAL(dnl.has(nameC, nonceC), false);
   dnl.add(nameC, nonceC);
   BOOST_CHECK_EQUAL(dnl.has(nameC, nonceC), true);
diff --git a/tests/test-common.cpp b/tests/test-common.cpp
index 9bc824a..8fe7c59 100644
--- a/tests/test-common.cpp
+++ b/tests/test-common.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,16 +32,14 @@
 
 shared_ptr<Interest>
 makeInterest(const Name& name, bool canBePrefix, optional<time::milliseconds> lifetime,
-             optional<uint32_t> nonce)
+             optional<Interest::Nonce> nonce)
 {
   auto interest = make_shared<Interest>(name);
   interest->setCanBePrefix(canBePrefix);
   if (lifetime) {
     interest->setInterestLifetime(*lifetime);
   }
-  if (nonce) {
-    interest->setNonce(*nonce);
-  }
+  interest->setNonce(nonce);
   return interest;
 }
 
@@ -59,7 +57,6 @@
   fakeSignature.setValue(ndn::encoding::makeEmptyBlock(tlv::SignatureValue));
   data.setSignature(fakeSignature);
   data.wireEncode();
-
   return data;
 }
 
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index e123b5e..c5c12bc 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -52,7 +52,7 @@
 shared_ptr<Interest>
 makeInterest(const Name& name, bool canBePrefix = false,
              optional<time::milliseconds> lifetime = nullopt,
-             optional<uint32_t> nonce = nullopt);
+             optional<Interest::Nonce> nonce = nullopt);
 
 /** \brief create a Data with fake signature
  *  \note Data may be modified afterwards without losing the fake signature.
@@ -76,34 +76,22 @@
 }
 
 /** \brief create a Nack
- *  \param interest Interest
- *  \param reason Nack reason
  */
 lp::Nack
 makeNack(Interest interest, lp::NackReason reason);
 
-/** \brief replace a name component
- *  \param[inout] name name
- *  \param index name component index
- *  \param a arguments to name::Component constructor
+/** \brief replace a name component in a packet
+ *  \param[inout] pkt the packet
+ *  \param index the index of the name component to replace
+ *  \param args arguments to name::Component constructor
  */
-template<typename... A>
+template<typename Packet, typename ...Args>
 void
-setNameComponent(Name& name, ssize_t index, A&&... a)
+setNameComponent(Packet& pkt, ssize_t index, Args&& ...args)
 {
-  Name name2 = name.getPrefix(index);
-  name2.append(name::Component(std::forward<A>(a)...));
-  name2.append(name.getSubName(name2.size()));
-  name = std::move(name2);
-}
-
-template<typename Packet, typename... A>
-void
-setNameComponent(Packet& packet, ssize_t index, A&&... a)
-{
-  Name name = packet.getName();
-  setNameComponent(name, index, std::forward<A>(a)...);
-  packet.setName(name);
+  Name name = pkt.getName();
+  name.set(index, name::Component(std::forward<Args>(args)...));
+  pkt.setName(name);
 }
 
 /** \brief create a prefix announcement without signing
