diff --git a/src/security/conf/checker.hpp b/src/security/conf/checker.hpp
index cb56d85..05eb8c1 100644
--- a/src/security/conf/checker.hpp
+++ b/src/security/conf/checker.hpp
@@ -380,8 +380,7 @@
     if (propertyIt != configSection.end())
       throw Error("Expect the end of checker!");
 
-    return make_shared<CustomizedChecker>(boost::cref(getSigType(sigType)),
-                                          boost::cref(keyLocatorChecker));
+    return make_shared<CustomizedChecker>(getSigType(sigType), cref(keyLocatorChecker));
   }
 
   static shared_ptr<Checker>
@@ -401,7 +400,7 @@
     if (propertyIt != configSection.end())
       throw Error("Expect the end of checker!");
 
-    return make_shared<HierarchicalChecker>(boost::cref(getSigType(sigType)));
+    return make_shared<HierarchicalChecker>(getSigType(sigType));
   }
 
   static shared_ptr<Checker>
diff --git a/src/security/conf/filter.hpp b/src/security/conf/filter.hpp
index 5891c76..8fa91b8 100644
--- a/src/security/conf/filter.hpp
+++ b/src/security/conf/filter.hpp
@@ -199,8 +199,8 @@
         if (propertyIt != configSection.end())
           throw Error("Expect the end of filter!");
 
-        return make_shared<RelationNameFilter>(boost::cref(name),
-                                               boost::cref(relation));
+        return make_shared<RelationNameFilter>(cref(name),
+                                               cref(relation));
       }
     else if (boost::iequals(propertyIt->first, "regex"))
       {
diff --git a/src/security/key-chain.cpp b/src/security/key-chain.cpp
index 58c3570..67cdda6 100644
--- a/src/security/key-chain.cpp
+++ b/src/security/key-chain.cpp
@@ -265,8 +265,8 @@
       m_pib->addCertificateAsIdentityDefault(*cert);
     }
 
-  shared_ptr<SecuredBag> secureBag = make_shared<SecuredBag>(boost::cref(*cert),
-                                                             boost::cref(pkcs5));
+  // make_shared on OSX 10.9 has some strange problem here
+  shared_ptr<SecuredBag> secureBag(new SecuredBag(*cert, pkcs5));
 
   return secureBag;
 }
diff --git a/src/security/sec-public-info-memory.cpp b/src/security/sec-public-info-memory.cpp
index f84b291..c9efc2f 100644
--- a/src/security/sec-public-info-memory.cpp
+++ b/src/security/sec-public-info-memory.cpp
@@ -61,7 +61,7 @@
 
   addIdentity(identityName);
 
-  m_keyStore[keyName.toUri()] = make_shared<KeyRecord>(keyType, boost::cref(publicKey));
+  m_keyStore[keyName.toUri()] = make_shared<KeyRecord>(keyType, cref(publicKey));
 }
 
 shared_ptr<PublicKey>
diff --git a/src/security/validator-config.cpp b/src/security/validator-config.cpp
index 80d2fb1..11f63a3 100644
--- a/src/security/validator-config.cpp
+++ b/src/security/validator-config.cpp
@@ -33,7 +33,7 @@
   , m_certificateCache(certificateCache)
 {
   if (!static_cast<bool>(m_certificateCache))
-    m_certificateCache = make_shared<CertificateCacheTtl>(boost::ref(m_face.getIoService()));
+    m_certificateCache = make_shared<CertificateCacheTtl>(ref(m_face.getIoService()));
 }
 
 void
diff --git a/src/security/validator-config.hpp b/src/security/validator-config.hpp
index 00d7c66..9dc69e3 100644
--- a/src/security/validator-config.hpp
+++ b/src/security/validator-config.hpp
@@ -209,7 +209,7 @@
           Interest certInterest(keyLocatorName);
 
           shared_ptr<ValidationRequest> nextStep =
-            make_shared<ValidationRequest>(boost::cref(certInterest),
+            make_shared<ValidationRequest>(cref(certInterest),
                                            onCertValidated,
                                            onCertValidationFailed,
                                            1, nSteps + 1);
@@ -229,7 +229,7 @@
                                  const OnFailed& onValidationFailed)
 {
   shared_ptr<IdentityCertificate> certificate =
-    make_shared<IdentityCertificate>(boost::cref(*signCertificate));
+    make_shared<IdentityCertificate>(cref(*signCertificate));
 
   if (!certificate->isTooLate() && !certificate->isTooEarly())
     {
diff --git a/src/security/validator-regex.cpp b/src/security/validator-regex.cpp
index c0797c7..b4fd1b8 100644
--- a/src/security/validator-regex.cpp
+++ b/src/security/validator-regex.cpp
@@ -36,7 +36,7 @@
   , m_certificateCache(certificateCache)
 {
   if (!static_cast<bool>(m_certificateCache))
-    m_certificateCache = make_shared<CertificateCacheTtl>(boost::ref(m_face.getIoService()));
+    m_certificateCache = make_shared<CertificateCacheTtl>(ref(m_face.getIoService()));
 }
 
 void
@@ -46,7 +46,7 @@
                                        const OnDataValidationFailed& onValidationFailed)
 {
   shared_ptr<IdentityCertificate> certificate =
-    make_shared<IdentityCertificate>(boost::cref(*signCertificate));
+    make_shared<IdentityCertificate>(cref(*signCertificate));
 
   if (!certificate->isTooLate() && !certificate->isTooEarly())
     {
@@ -137,7 +137,7 @@
 
                   Interest interest(sig.getKeyLocator().getName());
                   shared_ptr<ValidationRequest> nextStep =
-                    make_shared<ValidationRequest>(boost::cref(interest),
+                    make_shared<ValidationRequest>(cref(interest),
                                                    onKeyValidated,
                                                    onKeyValidationFailed,
                                                    3,
