diff --git a/include/threshold_event_monitor.hpp b/include/threshold_event_monitor.hpp
index 9352805..74cc86e 100644
--- a/include/threshold_event_monitor.hpp
+++ b/include/threshold_event_monitor.hpp
@@ -18,6 +18,7 @@
 #include <sel_logger.hpp>
 #include <sensorutils.hpp>
 #include <string_view>
+#include <variant>
 
 enum class thresholdEventOffsets : uint8_t
 {
@@ -46,13 +47,11 @@
 
         // Get the event type and assertion details from the message
         std::string thresholdInterface;
-        boost::container::flat_map<std::string,
-                                   sdbusplus::message::variant<bool>>
+        boost::container::flat_map<std::string, std::variant<bool>>
             propertiesChanged;
         msg.read(thresholdInterface, propertiesChanged);
         std::string event = propertiesChanged.begin()->first;
-        bool *pval = sdbusplus::message::variant_ns::get_if<bool>(
-            &propertiesChanged.begin()->second);
+        bool *pval = std::get_if<bool>(&propertiesChanged.begin()->second);
         if (!pval)
         {
             std::cerr << "threshold event direction has invalid type\n";
@@ -114,8 +113,7 @@
             conn->new_method_call(msg.get_sender(), msg.get_path(),
                                   "org.freedesktop.DBus.Properties", "GetAll");
         getSensorValue.append("xyz.openbmc_project.Sensor.Value");
-        boost::container::flat_map<std::string,
-                                   sdbusplus::message::variant<double>>
+        boost::container::flat_map<std::string, std::variant<double>>
             sensorValue;
         try
         {
@@ -129,12 +127,12 @@
                       << "\n";
             return;
         }
-        double max = sdbusplus::message::variant_ns::visit(
-            ipmi::VariantToDoubleVisitor(), sensorValue["MaxValue"]);
-        double min = sdbusplus::message::variant_ns::visit(
-            ipmi::VariantToDoubleVisitor(), sensorValue["MinValue"]);
-        double sensorVal = sdbusplus::message::variant_ns::visit(
-            ipmi::VariantToDoubleVisitor(), sensorValue["Value"]);
+        double max =
+            std::visit(ipmi::VariantToDoubleVisitor(), sensorValue["MaxValue"]);
+        double min =
+            std::visit(ipmi::VariantToDoubleVisitor(), sensorValue["MinValue"]);
+        double sensorVal =
+            std::visit(ipmi::VariantToDoubleVisitor(), sensorValue["Value"]);
         try
         {
             eventData[1] = ipmi::getScaledIPMIValue(sensorVal, max, min);
@@ -158,7 +156,7 @@
             conn->new_method_call(msg.get_sender(), msg.get_path(),
                                   "org.freedesktop.DBus.Properties", "Get");
         getThreshold.append(thresholdInterface, event);
-        sdbusplus::message::variant<double> thresholdValue;
+        std::variant<double> thresholdValue;
         try
         {
             sdbusplus::message::message getThresholdResp =
@@ -171,8 +169,8 @@
                       << msg.get_path() << "\n";
             return;
         }
-        double thresholdVal = sdbusplus::message::variant_ns::visit(
-            ipmi::VariantToDoubleVisitor(), thresholdValue);
+        double thresholdVal =
+            std::visit(ipmi::VariantToDoubleVisitor(), thresholdValue);
         try
         {
             eventData[2] = ipmi::getScaledIPMIValue(thresholdVal, max, min);
