diff --git a/src/power_control.cpp b/src/power_control.cpp
index 05aa45c..514806a 100644
--- a/src/power_control.cpp
+++ b/src/power_control.cpp
@@ -878,7 +878,7 @@
     {
         throw std::runtime_error("Invalid match");
     }
-    sdbusplus::message::message message(m);
+    sdbusplus::message_t message(m);
     PowerRestoreController* powerRestore =
         static_cast<PowerRestoreController*>(context);
 
@@ -1562,12 +1562,12 @@
         setRestartCause();
     }
 
-    static auto match = sdbusplus::bus::match::match(
+    static auto match = sdbusplus::bus::match_t(
         *conn,
         "type='signal',member='PropertiesChanged', "
         "interface='org.freedesktop.DBus.Properties', "
         "arg0='xyz.openbmc_project.State.Host'",
-        [](sdbusplus::message::message& message) {
+        [](sdbusplus::message_t& message) {
             std::string intfName;
             std::map<std::string, std::variant<std::string>> properties;
 
@@ -2105,13 +2105,13 @@
 {
     lg2::info("NMI Source Property Monitor");
 
-    static std::unique_ptr<sdbusplus::bus::match::match> nmiSourceMatch =
-        std::make_unique<sdbusplus::bus::match::match>(
+    static std::unique_ptr<sdbusplus::bus::match_t> nmiSourceMatch =
+        std::make_unique<sdbusplus::bus::match_t>(
             *conn,
             "type='signal',interface='org.freedesktop.DBus.Properties',"
             "member='PropertiesChanged',"
             "arg0namespace='xyz.openbmc_project.Chassis.Control.NMISource'",
-            [](sdbusplus::message::message& msg) {
+            [](sdbusplus::message_t& msg) {
                 std::string interfaceName;
                 boost::container::flat_map<std::string,
                                            std::variant<bool, std::string>>
@@ -2197,7 +2197,7 @@
     }
 }
 
-[[maybe_unused]] static void hostMiscHandler(sdbusplus::message::message& msg)
+[[maybe_unused]] static void hostMiscHandler(sdbusplus::message_t& msg)
 {
     std::string interfaceName;
     boost::container::flat_map<std::string, std::variant<bool>>
@@ -2392,7 +2392,7 @@
     return 0;
 }
 
-static bool getDbusMsgGPIOState(sdbusplus::message::message& msg,
+static bool getDbusMsgGPIOState(sdbusplus::message_t& msg,
                                 const std::string& lineName, bool& value)
 {
     std::string thresholdInterface;
@@ -2425,21 +2425,21 @@
     }
 }
 
-static sdbusplus::bus::match::match
+static sdbusplus::bus::match_t
     dbusGPIOMatcher(const ConfigData& cfg, std::function<void(bool)> onMatch)
 {
-    auto pulseEventMatcherCallback =
-        [&cfg, onMatch](sdbusplus::message::message& msg) {
-            bool value = false;
-            if (!getDbusMsgGPIOState(msg, cfg.lineName, value))
-            {
-                return;
-            }
-            onMatch(value);
-        };
+    auto pulseEventMatcherCallback = [&cfg,
+                                      onMatch](sdbusplus::message_t& msg) {
+        bool value = false;
+        if (!getDbusMsgGPIOState(msg, cfg.lineName, value))
+        {
+            return;
+        }
+        onMatch(value);
+    };
 
-    return sdbusplus::bus::match::match(
-        static_cast<sdbusplus::bus::bus&>(*conn),
+    return sdbusplus::bus::match_t(
+        static_cast<sdbusplus::bus_t&>(*conn),
         "type='signal',interface='org.freedesktop.DBus.Properties',member='"
         "PropertiesChanged',arg0='" +
             cfg.interface + "'",
@@ -2544,7 +2544,7 @@
     else if (powerOkConfig.type == ConfigType::DBUS)
     {
 
-        static sdbusplus::bus::match::match powerOkEventMonitor =
+        static sdbusplus::bus::match_t powerOkEventMonitor =
             power_control::dbusGPIOMatcher(powerOkConfig, psPowerOKHandler);
     }
     else
@@ -2567,7 +2567,7 @@
         }
         else if (sioPwrGoodConfig.type == ConfigType::DBUS)
         {
-            static sdbusplus::bus::match::match sioPwrGoodEventMonitor =
+            static sdbusplus::bus::match_t sioPwrGoodEventMonitor =
                 power_control::dbusGPIOMatcher(sioPwrGoodConfig,
                                                sioPowerGoodHandler);
         }
@@ -2590,7 +2590,7 @@
         }
         else if (sioOnControlConfig.type == ConfigType::DBUS)
         {
-            static sdbusplus::bus::match::match sioOnControlEventMonitor =
+            static sdbusplus::bus::match_t sioOnControlEventMonitor =
                 power_control::dbusGPIOMatcher(sioOnControlConfig,
                                                sioOnControlHandler);
         }
@@ -2612,7 +2612,7 @@
         }
         else if (sioS5Config.type == ConfigType::DBUS)
         {
-            static sdbusplus::bus::match::match sioS5EventMonitor =
+            static sdbusplus::bus::match_t sioS5EventMonitor =
                 power_control::dbusGPIOMatcher(sioS5Config, sioS5Handler);
         }
         else
@@ -2633,7 +2633,7 @@
     }
     else if (powerButtonConfig.type == ConfigType::DBUS)
     {
-        static sdbusplus::bus::match::match powerButtonEventMonitor =
+        static sdbusplus::bus::match_t powerButtonEventMonitor =
             power_control::dbusGPIOMatcher(powerButtonConfig,
                                            powerButtonHandler);
     }
@@ -2649,7 +2649,7 @@
     }
     else if (resetButtonConfig.type == ConfigType::DBUS)
     {
-        static sdbusplus::bus::match::match resetButtonEventMonitor =
+        static sdbusplus::bus::match_t resetButtonEventMonitor =
             power_control::dbusGPIOMatcher(resetButtonConfig,
                                            resetButtonHandler);
     }
@@ -2665,7 +2665,7 @@
     }
     else if (nmiButtonConfig.type == ConfigType::DBUS)
     {
-        static sdbusplus::bus::match::match nmiButtonEventMonitor =
+        static sdbusplus::bus::match_t nmiButtonEventMonitor =
             power_control::dbusGPIOMatcher(nmiButtonConfig, nmiButtonHandler);
     }
 
@@ -2680,12 +2680,12 @@
     }
     else if (idButtonConfig.type == ConfigType::DBUS)
     {
-        static sdbusplus::bus::match::match idButtonEventMonitor =
+        static sdbusplus::bus::match_t idButtonEventMonitor =
             power_control::dbusGPIOMatcher(idButtonConfig, idButtonHandler);
     }
 
 #ifdef USE_PLT_RST
-    sdbusplus::bus::match::match pltRstMatch(
+    sdbusplus::bus::match_t pltRstMatch(
         *conn,
         "type='signal',interface='org.freedesktop.DBus.Properties',member='"
         "PropertiesChanged',arg0='xyz.openbmc_project.State.Host.Misc'",
@@ -2703,7 +2703,7 @@
     }
     else if (postCompleteConfig.type == ConfigType::DBUS)
     {
-        static sdbusplus::bus::match::match postCompleteEventMonitor =
+        static sdbusplus::bus::match_t postCompleteEventMonitor =
             power_control::dbusGPIOMatcher(postCompleteConfig,
                                            postCompleteHandler);
     }
diff --git a/src/power_control.hpp b/src/power_control.hpp
index 9e54184..fe36b26 100644
--- a/src/power_control.hpp
+++ b/src/power_control.hpp
@@ -60,7 +60,7 @@
     bool policyInvoked;
     std::string powerRestorePolicy;
     int powerRestoreDelay;
-    std::list<sdbusplus::bus::match::match> matches;
+    std::list<sdbusplus::bus::match_t> matches;
     boost::asio::steady_timer powerRestoreTimer;
     bool timerFired;
 #ifdef USE_ACBOOT
