diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index 8dfcba2..e1443df 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -57,15 +57,15 @@
 }
 
 void
-AccessStrategy::afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+AccessStrategy::afterReceiveInterest(const Interest& interest, const FaceEndpoint& ingress,
                                      const shared_ptr<pit::Entry>& pitEntry)
 {
   auto suppressResult = m_retxSuppression.decidePerPitEntry(*pitEntry);
   switch (suppressResult) {
   case RetxSuppressionResult::NEW:
-    return afterReceiveNewInterest(ingress, interest, pitEntry);
+    return afterReceiveNewInterest(interest, ingress, pitEntry);
   case RetxSuppressionResult::FORWARD:
-    return afterReceiveRetxInterest(ingress, interest, pitEntry);
+    return afterReceiveRetxInterest(interest, ingress, pitEntry);
   case RetxSuppressionResult::SUPPRESS:
     NFD_LOG_DEBUG(interest << " interestFrom " << ingress << " retx-suppress");
     return;
@@ -73,7 +73,7 @@
 }
 
 void
-AccessStrategy::afterReceiveNewInterest(const FaceEndpoint& ingress, const Interest& interest,
+AccessStrategy::afterReceiveNewInterest(const Interest& interest, const FaceEndpoint& ingress,
                                         const shared_ptr<pit::Entry>& pitEntry)
 {
   const auto& fibEntry = this->lookupFib(*pitEntry);
@@ -86,7 +86,7 @@
     NFD_LOG_DEBUG(interest << " interestFrom " << ingress << " new-interest mi=" << miName);
 
     // send to last working nexthop
-    bool isSentToLastNexthop = this->sendToLastNexthop(ingress, interest, pitEntry, *mi, fibEntry);
+    bool isSentToLastNexthop = this->sendToLastNexthop(interest, ingress, pitEntry, *mi, fibEntry);
     if (isSentToLastNexthop) {
       return;
     }
@@ -98,7 +98,7 @@
   // no measurements, or last working nexthop unavailable
 
   // multicast to all nexthops except incoming face
-  size_t nMulticastSent = this->multicast(ingress.face, interest, pitEntry, fibEntry);
+  size_t nMulticastSent = this->multicast(interest, ingress.face, pitEntry, fibEntry);
 
   if (nMulticastSent == 0) {
     this->rejectPendingInterest(pitEntry);
@@ -106,16 +106,16 @@
 }
 
 void
-AccessStrategy::afterReceiveRetxInterest(const FaceEndpoint& ingress, const Interest& interest,
+AccessStrategy::afterReceiveRetxInterest(const Interest& interest, const FaceEndpoint& ingress,
                                          const shared_ptr<pit::Entry>& pitEntry)
 {
   const auto& fibEntry = this->lookupFib(*pitEntry);
   NFD_LOG_DEBUG(interest << " interestFrom " << ingress << " retx-forward");
-  this->multicast(ingress.face, interest, pitEntry, fibEntry);
+  this->multicast(interest, ingress.face, pitEntry, fibEntry);
 }
 
 bool
-AccessStrategy::sendToLastNexthop(const FaceEndpoint& ingress, const Interest& interest,
+AccessStrategy::sendToLastNexthop(const Interest& interest, const FaceEndpoint& ingress,
                                   const shared_ptr<pit::Entry>& pitEntry, MtInfo& mi,
                                   const fib::Entry& fibEntry)
 {
@@ -144,7 +144,7 @@
   NFD_LOG_DEBUG(pitEntry->getInterest() << " interestTo " << mi.lastNexthop
                 << " last-nexthop rto=" << time::duration_cast<time::microseconds>(rto).count());
 
-  if (!this->sendInterest(pitEntry, *outFace, interest)) {
+  if (!this->sendInterest(interest, *outFace, pitEntry)) {
     return false;
   }
 
@@ -184,11 +184,11 @@
 
   NFD_LOG_DEBUG(pitEntry->getInterest() << " timeoutFrom " << firstOutFaceId
                 << " multicast-except " << firstOutFaceId);
-  this->multicast(*inFace, interest, pitEntry, fibEntry, firstOutFaceId);
+  this->multicast(interest, *inFace, pitEntry, fibEntry, firstOutFaceId);
 }
 
 size_t
-AccessStrategy::multicast(const Face& inFace, const Interest& interest,
+AccessStrategy::multicast(const Interest& interest, const Face& inFace,
                           const shared_ptr<pit::Entry>& pitEntry, const fib::Entry& fibEntry,
                           FaceId exceptFace)
 {
@@ -200,7 +200,7 @@
       continue;
     }
     NFD_LOG_DEBUG(pitEntry->getInterest() << " interestTo " << outFace.getId() << " multicast");
-    if (this->sendInterest(pitEntry, outFace, interest)) {
+    if (this->sendInterest(interest, outFace, pitEntry)) {
       ++nSent;
     }
   }
@@ -208,8 +208,8 @@
 }
 
 void
-AccessStrategy::beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
-                                      const FaceEndpoint& ingress, const Data& data)
+AccessStrategy::beforeSatisfyInterest(const Data& data, const FaceEndpoint& ingress,
+                                      const shared_ptr<pit::Entry>& pitEntry)
 {
   PitInfo* pi = pitEntry->getStrategyInfo<PitInfo>();
   if (pi != nullptr) {
