diff --git a/src/associations.cpp b/src/associations.cpp
index 79672af..6dbc710 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -1,9 +1,9 @@
 #include "associations.hpp"
 
-#include <boost/algorithm/string/predicate.hpp>
 #include <sdbusplus/exception.hpp>
 
 #include <iostream>
+#include <string>
 
 void removeAssociation(const std::string& sourcePath, const std::string& owner,
                        sdbusplus::asio::object_server& server,
@@ -462,8 +462,7 @@
                                 endpoints.begin(), endpoints.end(), otherPath);
                             if (endpoint != endpoints.end())
                             {
-                                return boost::starts_with(ap.first,
-                                                          endpointPath + '/');
+                                return ap.first.starts_with(endpointPath + '/');
                             }
                             return false;
                         });
diff --git a/src/main.cpp b/src/main.cpp
index 1e3883f..109b1b3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,7 +5,6 @@
 
 #include <tinyxml2.h>
 
-#include <boost/algorithm/string/predicate.hpp>
 #include <boost/asio/io_context.hpp>
 #include <boost/asio/signal_set.hpp>
 #include <boost/container/flat_map.hpp>
@@ -30,7 +29,7 @@
                   boost::container::flat_map<std::string, std::string>& owners,
                   const std::string& newObject)
 {
-    if (boost::starts_with(newObject, ":"))
+    if (newObject.starts_with(":"))
     {
         return;
     }
@@ -430,7 +429,7 @@
         auto child = std::find_if(
             interfaceMap.begin(), interfaceMap.end(),
             [&owner, &childPath](const auto& entry) {
-                return boost::starts_with(entry.first, childPath) &&
+                return entry.first.starts_with(childPath) &&
                        (entry.second.find(owner) != entry.second.end());
             });
 
@@ -456,7 +455,7 @@
     // Interfaces need to be sorted for intersect to function
     std::sort(interfaces.begin(), interfaces.end());
 
-    if (boost::ends_with(reqPath, "/"))
+    if (reqPath.ends_with("/"))
     {
         reqPath.pop_back();
     }
@@ -476,7 +475,7 @@
             continue;
         }
 
-        if (boost::starts_with(reqPath, thisPath))
+        if (reqPath.starts_with(thisPath))
         {
             if (interfaces.empty())
             {
@@ -549,7 +548,7 @@
 
     // reqPath is now guaranteed to have a trailing "/" while reqPathStripped
     // will be guaranteed not to have a trailing "/"
-    if (!boost::ends_with(reqPath, "/"))
+    if (!reqPath.ends_with("/"))
     {
         reqPath += "/";
     }
@@ -574,7 +573,7 @@
             continue;
         }
 
-        if (boost::starts_with(thisPath, reqPath))
+        if (thisPath.starts_with(reqPath))
         {
             // count the number of slashes past the stripped search term
             int32_t thisDepth = std::count(
@@ -611,7 +610,7 @@
 
     // reqPath is now guaranteed to have a trailing "/" while reqPathStripped
     // will be guaranteed not to have a trailing "/"
-    if (!boost::ends_with(reqPath, "/"))
+    if (!reqPath.ends_with("/"))
     {
         reqPath += "/";
     }
@@ -636,7 +635,7 @@
             continue;
         }
 
-        if (boost::starts_with(thisPath, reqPath))
+        if (thisPath.starts_with(reqPath))
         {
             // count the number of slashes past the stripped search term
             int thisDepth = std::count(
diff --git a/src/processing.cpp b/src/processing.cpp
index 561cbde..5a733d4 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -1,15 +1,14 @@
 #include "processing.hpp"
 
-#include <boost/algorithm/string/predicate.hpp>
-
 #include <iostream>
+#include <string>
 
 bool getWellKnown(
     const boost::container::flat_map<std::string, std::string>& owners,
     const std::string& request, std::string& wellKnown)
 {
     // If it's already a well known name, just return
-    if (!boost::starts_with(request, ":"))
+    if (!request.starts_with(":"))
     {
         wellKnown = request;
         return true;
@@ -27,11 +26,10 @@
 bool needToIntrospect(const std::string& processName,
                       const AllowDenyList& allowList)
 {
-    auto inAllowList =
-        std::find_if(allowList.begin(), allowList.end(),
-                     [&processName](const auto& prefix) {
-                         return boost::starts_with(processName, prefix);
-                     }) != allowList.end();
+    auto inAllowList = std::find_if(allowList.begin(), allowList.end(),
+                                    [&processName](const auto& prefix) {
+                                        return processName.starts_with(prefix);
+                                    }) != allowList.end();
 
     return inAllowList;
 }
@@ -42,7 +40,7 @@
     InterfaceMapType& interfaceMap, AssociationMaps& assocMaps,
     sdbusplus::asio::object_server& server)
 {
-    if (boost::starts_with(oldOwner, ":"))
+    if (oldOwner.starts_with(":"))
     {
         auto it = nameOwners.find(oldOwner);
         if (it != nameOwners.end())
