diff --git a/src/chat-dialog-backend.cpp b/src/chat-dialog-backend.cpp
index ff0a600..c72d7ed 100644
--- a/src/chat-dialog-backend.cpp
+++ b/src/chat-dialog-backend.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2013-2020, Regents of the University of California
+ * Copyright (c) 2013-2021, Regents of the University of California
  *                          Yingdi Yu
  *
  * BSD license, See the LICENSE file for more information
@@ -104,20 +104,20 @@
 {
   BOOST_ASSERT(m_sock == nullptr);
 
-  m_face = make_shared<ndn::Face>();
-  m_scheduler = unique_ptr<ndn::Scheduler>(new ndn::Scheduler(m_face->getIoService()));
+  m_face = std::make_shared<ndn::Face>();
+  m_scheduler = std::make_unique<ndn::Scheduler>(m_face->getIoService());
 
   // initialize validator
-  m_validator = make_shared<ndn::security::ValidatorConfig>(*m_face);
+  m_validator = std::make_shared<ndn::security::ValidatorConfig>(*m_face);
   m_validator->load("security/validation-chat.conf");
 
   // create a new SyncSocket
-  m_sock = make_shared<chronosync::Socket>(m_chatroomPrefix,
-                                           m_routableUserChatPrefix,
-                                           ref(*m_face),
-                                           bind(&ChatDialogBackend::processSyncUpdate, this, _1),
-                                           m_signingId,
-                                           m_validator);
+  m_sock = std::make_shared<chronosync::Socket>(m_chatroomPrefix,
+                                                m_routableUserChatPrefix,
+                                                ref(*m_face),
+                                                bind(&ChatDialogBackend::processSyncUpdate, this, _1),
+                                                m_signingId,
+                                                m_validator);
 
   // schedule a new join event
   m_scheduler->schedule(time::milliseconds(600),
diff --git a/src/chatroom-discovery-backend.cpp b/src/chatroom-discovery-backend.cpp
index 8e2ad21..504a4c2 100644
--- a/src/chatroom-discovery-backend.cpp
+++ b/src/chatroom-discovery-backend.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2020, Regents of the University of California
+ * Copyright (c) 2013-2021, Regents of the University of California
  *
  * BSD license, See the LICENSE file for more information
  *
@@ -99,11 +99,11 @@
   m_face = shared_ptr<ndn::Face>(new ndn::Face);
   m_scheduler = unique_ptr<ndn::Scheduler>(new ndn::Scheduler(m_face->getIoService()));
 
-  m_sock = make_shared<chronosync::Socket>(m_discoveryPrefix,
-                                           Name(),
-                                           ref(*m_face),
-                                           bind(&ChatroomDiscoveryBackend::processSyncUpdate,
-                                                this, _1));
+  m_sock = std::make_shared<chronosync::Socket>(m_discoveryPrefix,
+                                                Name(),
+                                                ref(*m_face),
+                                                bind(&ChatroomDiscoveryBackend::processSyncUpdate,
+                                                     this, _1));
 
   // add an timer to refresh front end
   m_refreshPanelId = m_scheduler->schedule(REFRESH_INTERVAL,
diff --git a/src/common.hpp b/src/common.hpp
index 90f5e54..8cd384e 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -1,7 +1,7 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2020, Regents of the University of California
- *                     Yingdi Yu
+ * Copyright (c) 2013-2021, Regents of the University of California
+ *                          Yingdi Yu
  *
  * BSD license, See the LICENSE file for more information
  *
@@ -44,7 +44,6 @@
 
 using std::shared_ptr;
 using std::unique_ptr;
-using std::make_shared;
 using std::function;
 using std::bind;
 
diff --git a/src/contact-manager.cpp b/src/contact-manager.cpp
index 5a6b4b9..04700f5 100644
--- a/src/contact-manager.cpp
+++ b/src/contact-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2013-2020, Regents of the University of California
+ * Copyright (c) 2013-2021, Regents of the University of California
  *                          Yingdi Yu
  *
  * BSD license, See the LICENSE file for more information
@@ -58,7 +58,7 @@
 void
 ContactManager::initializeSecurity()
 {
-  m_validator = make_shared<ndn::security::ValidatorConfig>(m_face);
+  m_validator = std::make_shared<ndn::security::ValidatorConfig>(m_face);
   m_validator->load("security/validation-contact-manager.conf");
 }
 
@@ -113,7 +113,7 @@
 {
   const Profile& profile = m_bufferedContacts[identity].m_selfEndorseCert->getProfile();
 
-  shared_ptr<EndorseInfo> endorseInfo = make_shared<EndorseInfo>();
+  auto endorseInfo = std::make_shared<EndorseInfo>();
   m_bufferedContacts[identity].m_endorseInfo = endorseInfo;
 
   map<string, size_t> endorseCount;
@@ -163,8 +163,7 @@
   try {
     Data plainData;
     plainData.wireDecode(data.getContent().blockFromValue());
-    shared_ptr<EndorseCertificate> selfEndorseCertificate =
-      make_shared<EndorseCertificate>(boost::cref(plainData));
+    auto selfEndorseCertificate = std::make_shared<EndorseCertificate>(plainData);
 
     if (ndn::security::verifySignature(plainData, *selfEndorseCertificate)) {
       m_bufferedContacts[identity].m_selfEndorseCert = selfEndorseCertificate;
@@ -208,8 +207,7 @@
                                              const Name& identity)
 {
   try {
-    shared_ptr<EndorseCollection> endorseCollection =
-      make_shared<EndorseCollection>(data.getContent().blockFromValue());
+    auto endorseCollection = std::make_shared<EndorseCollection>(data.getContent().blockFromValue());
     m_bufferedContacts[identity].m_endorseCollection = endorseCollection;
     fetchEndorseCertificateInternal(identity, 0);
   }
@@ -245,7 +243,7 @@
   }
 
   if (ss.str() == hash) {
-    auto endorseCertificate = make_shared<EndorseCertificate>(data);
+    auto endorseCertificate = std::make_shared<EndorseCertificate>(data);
     m_bufferedContacts[identity].m_endorseCertList.push_back(std::move(endorseCertificate));
   }
 
@@ -332,7 +330,7 @@
   Name dnsName = m_identity;
   dnsName.append("DNS").append("ENDORSED").appendVersion();
 
-  shared_ptr<Data> data = make_shared<Data>();
+  auto data = std::make_shared<Data>();
   data->setName(dnsName);
   data->setFreshnessPeriod(time::milliseconds(1000));
 
@@ -350,7 +348,7 @@
 void
 ContactManager::onIdentityCertValidated(const Data& data)
 {
-  shared_ptr<Certificate> cert = make_shared<Certificate>(boost::cref(data));
+  auto cert = std::make_shared<Certificate>(data);
   m_bufferedIdCerts[cert->getName()] = cert;
   decreaseIdCertCount();
 }
@@ -402,10 +400,7 @@
   for (auto it = profile.begin(); it != profile.end(); it++)
     endorseList.push_back(it->first);
 
-  shared_ptr<EndorseCertificate> selfEndorseCertificate =
-    make_shared<EndorseCertificate>(boost::cref(signCert),
-                                    boost::cref(profile),
-                                    boost::cref(endorseList));
+  auto selfEndorseCertificate = std::make_shared<EndorseCertificate>(signCert, profile, endorseList);
 
   m_keyChain.sign(*selfEndorseCertificate,
                   ndn::security::signingByIdentity(m_identity).setSignatureInfo(
@@ -420,7 +415,7 @@
   Name dnsName = m_identity;
   dnsName.append("DNS").append("PROFILE").appendVersion();
 
-  shared_ptr<Data> data = make_shared<Data>();
+  auto data = std::make_shared<Data>();
   data->setName(dnsName);
   data->setContent(selfEndorseCertificate.wireEncode());
   data->setFreshnessPeriod(time::milliseconds(1000));
@@ -472,7 +467,7 @@
     .append("ENDORSEE")
     .appendVersion();
 
-  shared_ptr<Data> data = make_shared<Data>();
+  auto data = std::make_shared<Data>();
   data->setName(dnsName);
   data->setContent(endorseCertificate.wireEncode());
   data->setFreshnessPeriod(time::milliseconds(1000));
@@ -582,7 +577,7 @@
 {
   m_identity = Name(identity.toStdString());
 
-  m_contactStorage = make_shared<ContactStorage>(m_identity);
+  m_contactStorage = std::make_shared<ContactStorage>(m_identity);
 
   m_dnsListenerHandle = m_face.setInterestFilter(
     Name(m_identity).append("DNS"),
diff --git a/src/contact-storage.cpp b/src/contact-storage.cpp
index 6703f41..9357bed 100644
--- a/src/contact-storage.cpp
+++ b/src/contact-storage.cpp
@@ -1,7 +1,7 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2020, Regents of the University of California
- *                     Yingdi Yu
+ * Copyright (c) 2013-2021, Regents of the University of California
+ *                          Yingdi Yu
  *
  * BSD license, See the LICENSE file for more information
  *
@@ -227,7 +227,7 @@
 shared_ptr<Profile>
 ContactStorage::getSelfProfile()
 {
-  shared_ptr<Profile> profile = make_shared<Profile>(m_identity);
+  auto profile = std::make_shared<Profile>(m_identity);
   sqlite3_stmt *stmt;
   sqlite3_prepare_v2(m_db, "SELECT profile_type, profile_value FROM SelfProfile",
                      -1, &stmt, nullptr);
@@ -268,7 +268,7 @@
   sqlite3_bind_string(stmt, 1, m_identity.toUri(), SQLITE_TRANSIENT);
 
   if (sqlite3_step(stmt) == SQLITE_ROW) {
-    cert = make_shared<EndorseCertificate>();
+    cert = std::make_shared<EndorseCertificate>();
     cert->wireDecode(sqlite3_column_block(stmt, 0));
   }
 
@@ -347,7 +347,7 @@
   sqlite3_bind_string(stmt, 1, name.toUri(), SQLITE_TRANSIENT);
 
   if (sqlite3_step(stmt) == SQLITE_ROW) {
-    cert = make_shared<EndorseCertificate>();
+    cert = std::make_shared<EndorseCertificate>();
     cert->wireDecode(sqlite3_column_block(stmt, 1));
   }
 
@@ -481,8 +481,8 @@
       time::fromUnixTimestamp(time::milliseconds(sqlite3_column_int64 (stmt, 4)));
     int isIntroducer = sqlite3_column_int (stmt, 5);
 
-    contact = make_shared<Contact>(identity, alias, Name(keyName),
-                                   notBefore, notAfter, key, isIntroducer);
+    contact = std::make_shared<Contact>(identity, alias, Name(keyName),
+                                        notBefore, notAfter, key, isIntroducer);
   }
   sqlite3_finalize(stmt);
 
@@ -617,7 +617,7 @@
   sqlite3_bind_string(stmt, 1, dataName.toUri(), SQLITE_TRANSIENT);
 
   if (sqlite3_step(stmt) == SQLITE_ROW) {
-    data = make_shared<Data>();
+    data = std::make_shared<Data>();
     data->wireDecode(sqlite3_column_block(stmt, 0));
   }
   sqlite3_finalize(stmt);
@@ -637,7 +637,7 @@
   sqlite3_bind_string(stmt, 2, type, SQLITE_TRANSIENT);
 
   if (sqlite3_step(stmt) == SQLITE_ROW) {
-    data = make_shared<Data>();
+    data = std::make_shared<Data>();
     data->wireDecode(sqlite3_column_block(stmt, 0));
   }
   sqlite3_finalize(stmt);
diff --git a/src/controller-backend.cpp b/src/controller-backend.cpp
index 9078cf2..f28ec8c 100644
--- a/src/controller-backend.cpp
+++ b/src/controller-backend.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2013-2020, Regents of the University of California
+ * Copyright (c) 2013-2021, Regents of the University of California
  *                          Yingdi Yu
  *
  * BSD license, See the LICENSE file for more information
@@ -45,12 +45,10 @@
   connect(&m_contactManager, SIGNAL(contactIdListReady(const QStringList&)),
           this, SLOT(onContactIdListReady(const QStringList&)));
 
-  m_validator = make_shared<ndn::security::ValidatorNull>();
+  m_validator = std::make_shared<ndn::security::ValidatorNull>();
 }
 
-ControllerBackend::~ControllerBackend()
-{
-}
+ControllerBackend::~ControllerBackend() = default;
 
 void
 ControllerBackend::run()
@@ -160,8 +158,7 @@
                                         const ndn::Interest& interest,
                                         size_t routingPrefixOffset)
 {
-  shared_ptr<Interest> invitationInterest =
-    make_shared<Interest>(interest.getName().getSubName(routingPrefixOffset));
+  auto invitationInterest = std::make_shared<Interest>(interest.getName().getSubName(routingPrefixOffset));
 
   // check if the chatroom already exists;
   try {
@@ -371,7 +368,7 @@
 void
 ControllerBackend::onInvitationResponded(const ndn::Name& invitationName, bool accepted)
 {
-  shared_ptr<Data> response = make_shared<Data>();
+  auto response = std::make_shared<Data>();
   shared_ptr<ndn::security::Certificate> chatroomCert;
 
   // generate reply;
@@ -383,7 +380,7 @@
 
     // We should create a particular certificate for this chatroom,
     //but let's use default one for now.
-    chatroomCert = make_shared<ndn::security::Certificate>(
+    chatroomCert = std::make_shared<ndn::security::Certificate>(
       m_keyChain.createIdentity(m_identity).getDefaultKey().getDefaultCertificate());
 
     response->setContent(chatroomCert->wireEncode());
@@ -406,7 +403,7 @@
       .append(ROUTING_HINT_SEPARATOR)
       .append(response->getName());
 
-    shared_ptr<Data> wrappedData = make_shared<Data>(wrappedName);
+    auto wrappedData = std::make_shared<Data>(wrappedName);
     wrappedData->setContent(response->wireEncode());
     wrappedData->setFreshnessPeriod(time::milliseconds(1000));
 
@@ -422,7 +419,7 @@
 ControllerBackend::onInvitationRequestResponded(const ndn::Name& invitationResponseName,
                                                 bool accepted)
 {
-  shared_ptr<Data> response = make_shared<Data>(invitationResponseName);
+  auto response = std::make_shared<Data>(invitationResponseName);
   if (accepted)
     response->setContent(ndn::makeNonNegativeIntegerBlock(tlv::Content, 1));
   else
@@ -466,7 +463,6 @@
 
   // for (ContactList::const_iterator it  = contactList.begin(); it != contactList.end(); it++)
     // m_validator.addTrustAnchor((*it)->getPublicKeyName(), (*it)->getPublicKey());
-
 }
 
 void
@@ -476,7 +472,6 @@
   m_isNfdConnected = true;
 }
 
-
 } // namespace chronochat
 
 #if WAF
