diff --git a/app/watchdog_service.cpp b/app/watchdog_service.cpp
index 284964d..0b88369 100644
--- a/app/watchdog_service.cpp
+++ b/app/watchdog_service.cpp
@@ -16,8 +16,6 @@
 using phosphor::logging::entry;
 using phosphor::logging::level;
 using phosphor::logging::log;
-using sdbusplus::message::variant_ns::get;
-using sdbusplus::message::variant_ns::variant;
 using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 using sdbusplus::xyz::openbmc_project::State::server::convertForMessage;
 using sdbusplus::xyz::openbmc_project::State::server::Watchdog;
@@ -72,18 +70,20 @@
     }
     try
     {
-        std::map<std::string, variant<bool, uint64_t, std::string>> properties;
+        std::map<std::string, std::variant<bool, uint64_t, std::string>>
+            properties;
         response.read(properties);
         Properties wd_prop;
-        wd_prop.initialized = get<bool>(properties.at("Initialized"));
-        wd_prop.enabled = get<bool>(properties.at("Enabled"));
+        wd_prop.initialized = std::get<bool>(properties.at("Initialized"));
+        wd_prop.enabled = std::get<bool>(properties.at("Enabled"));
         wd_prop.expireAction = Watchdog::convertActionFromString(
-            get<std::string>(properties.at("ExpireAction")));
+            std::get<std::string>(properties.at("ExpireAction")));
         wd_prop.timerUse = Watchdog::convertTimerUseFromString(
-            get<std::string>(properties.at("CurrentTimerUse")));
+            std::get<std::string>(properties.at("CurrentTimerUse")));
 
-        wd_prop.interval = get<uint64_t>(properties.at("Interval"));
-        wd_prop.timeRemaining = get<uint64_t>(properties.at("TimeRemaining"));
+        wd_prop.interval = std::get<uint64_t>(properties.at("Interval"));
+        wd_prop.timeRemaining =
+            std::get<uint64_t>(properties.at("TimeRemaining"));
         return wd_prop;
     }
     catch (const std::exception& e)
@@ -121,9 +121,9 @@
     }
     try
     {
-        variant<T> value;
+        std::variant<T> value;
         response.read(value);
-        return get<T>(value);
+        return std::get<T>(value);
     }
     catch (const std::exception& e)
     {
@@ -145,7 +145,7 @@
 {
     bool wasValid = wd_service.isValid(bus);
     auto request = wd_service.newMethodCall(bus, prop_intf, "Set");
-    request.append(wd_intf, key, variant<T>(val));
+    request.append(wd_intf, key, std::variant<T>(val));
     auto response = bus.call(request);
     if (response.is_method_error())
     {
diff --git a/apphandler.cpp b/apphandler.cpp
index 8be092c..87f45d2 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -57,7 +57,6 @@
     sdbusplus::xyz::openbmc_project::Software::server::Activation;
 using BMC = sdbusplus::xyz::openbmc_project::State::server::BMC;
 namespace fs = std::filesystem;
-namespace variant_ns = sdbusplus::message::variant_ns;
 
 /**
  * @brief Returns the Version info from primary s/w object
@@ -106,14 +105,14 @@
                 auto& redundancyPriorityProps = intfMap.at(redundancyIntf);
                 auto& versionProps = intfMap.at(versionIntf);
                 auto& activationProps = intfMap.at(activationIntf);
-                auto priority = variant_ns::get<uint8_t>(
-                    redundancyPriorityProps.at("Priority"));
+                auto priority =
+                    std::get<uint8_t>(redundancyPriorityProps.at("Priority"));
                 auto purpose =
-                    variant_ns::get<std::string>(versionProps.at("Purpose"));
-                auto activation = variant_ns::get<std::string>(
-                    activationProps.at("Activation"));
+                    std::get<std::string>(versionProps.at("Purpose"));
+                auto activation =
+                    std::get<std::string>(activationProps.at("Activation"));
                 auto version =
-                    variant_ns::get<std::string>(versionProps.at("Version"));
+                    std::get<std::string>(versionProps.at("Version"));
                 if ((Version::convertVersionPurposeFromString(purpose) ==
                      Version::VersionPurpose::BMC) &&
                     (Activation::convertActivationsFromString(activation) ==
@@ -154,9 +153,9 @@
         ipmi::getDbusProperty(bus, bmcObject.second, bmcObject.first,
                               bmc_state_interface, bmc_state_property);
 
-    return variant_ns::holds_alternative<std::string>(variant) &&
-           BMC::convertBMCStateFromString(
-               variant_ns::get<std::string>(variant)) == BMC::BMCState::Ready;
+    return std::holds_alternative<std::string>(variant) &&
+           BMC::convertBMCStateFromString(std::get<std::string>(variant)) ==
+               BMC::BMCState::Ready;
 }
 
 namespace acpi_state
@@ -407,7 +406,7 @@
             bus, acpiObject.second, acpiObject.first, acpi_state::acpiInterface,
             acpi_state::sysACPIProp);
         auto sysACPI = acpi_state::ACPIPowerState::convertACPIFromString(
-            variant_ns::get<std::string>(sysACPIVal));
+            std::get<std::string>(sysACPIVal));
         res->sysACPIState =
             static_cast<uint8_t>(acpi_state::dbusToIPMI.at(sysACPI));
 
@@ -415,7 +414,7 @@
             bus, acpiObject.second, acpiObject.first, acpi_state::acpiInterface,
             acpi_state::devACPIProp);
         auto devACPI = acpi_state::ACPIPowerState::convertACPIFromString(
-            variant_ns::get<std::string>(devACPIVal));
+            std::get<std::string>(devACPIVal));
         res->devACPIState =
             static_cast<uint8_t>(acpi_state::dbusToIPMI.at(devACPI));
 
@@ -803,7 +802,7 @@
         auto variant =
             ipmi::getDbusProperty(bus, bmcObject.second, bmcObject.first,
                                   bmc_guid_interface, bmc_guid_property);
-        std::string guidProp = variant_ns::get<std::string>(variant);
+        std::string guidProp = std::get<std::string>(variant);
 
         // Erase "-" characters from the property value
         guidProp.erase(std::remove(guidProp.begin(), guidProp.end(), '-'),
diff --git a/chassishandler.cpp b/chassishandler.cpp
index f8a93b0..7aa3f98 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -136,7 +136,6 @@
 using namespace phosphor::logging;
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 using namespace sdbusplus::xyz::openbmc_project::Control::Boot::server;
-namespace variant_ns = sdbusplus::message::variant_ns;
 
 namespace chassis
 {
@@ -216,19 +215,19 @@
                                              macObjectInfo.first, MAC_INTERFACE,
                                              "MACAddress");
 
-        auto ipAddress = variant_ns::get<std::string>(properties["Address"]);
+        auto ipAddress = std::get<std::string>(properties["Address"]);
 
-        auto gateway = variant_ns::get<std::string>(properties["Gateway"]);
+        auto gateway = std::get<std::string>(properties["Gateway"]);
 
-        auto prefix = variant_ns::get<uint8_t>(properties["PrefixLength"]);
+        auto prefix = std::get<uint8_t>(properties["PrefixLength"]);
 
         uint8_t isStatic =
-            (variant_ns::get<std::string>(properties["Origin"]) ==
+            (std::get<std::string>(properties["Origin"]) ==
              "xyz.openbmc_project.Network.IP.AddressOrigin.Static")
                 ? 1
                 : 0;
 
-        auto MACAddress = variant_ns::get<std::string>(variant);
+        auto MACAddress = std::get<std::string>(variant);
 
         // it is expected here that we should get the valid data
         // but we may also get the default values.
@@ -266,11 +265,10 @@
         std::memcpy(respptr->data + ADDRTYPE_OFFSET, &isStatic,
                     sizeof(isStatic));
 
-        uint8_t addressFamily =
-            (variant_ns::get<std::string>(properties["Type"]) ==
-             "xyz.openbmc_project.Network.IP.Protocol.IPv4")
-                ? AF_INET
-                : AF_INET6;
+        uint8_t addressFamily = (std::get<std::string>(properties["Type"]) ==
+                                 "xyz.openbmc_project.Network.IP.Protocol.IPv4")
+                                    ? AF_INET
+                                    : AF_INET6;
 
         addrSize = (addressFamily == AF_INET)
                        ? ipmi::network::IPV4_ADDRESS_SIZE_BYTE
@@ -504,7 +502,7 @@
         ipmi::getDbusProperty(bus, service, chassisStateObj.first,
                               chassisPOHStateIntf, pOHCounterProperty);
 
-    return variant_ns::get<uint32_t>(propValue);
+    return std::get<uint32_t>(propValue);
 }
 
 ipmi_ret_t ipmi_chassis_wildcard(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
@@ -558,38 +556,37 @@
         ipmi::Value variant = ipmi::getDbusProperty(
             bus, chassisCapObject.second, chassisCapObject.first,
             chassisCapIntf, chassisCapFlagsProp);
-        chassis_cap.cap_flags = variant_ns::get<uint8_t>(variant);
+        chassis_cap.cap_flags = std::get<uint8_t>(variant);
 
         variant = ipmi::getDbusProperty(bus, chassisCapObject.second,
                                         chassisCapObject.first, chassisCapIntf,
                                         chassisFRUDevAddrProp);
         // Chassis FRU info Device Address.
-        chassis_cap.fru_info_dev_addr = variant_ns::get<uint8_t>(variant);
+        chassis_cap.fru_info_dev_addr = std::get<uint8_t>(variant);
 
         variant = ipmi::getDbusProperty(bus, chassisCapObject.second,
                                         chassisCapObject.first, chassisCapIntf,
                                         chassisSDRDevAddrProp);
         // Chassis SDR Device Address.
-        chassis_cap.sdr_dev_addr = variant_ns::get<uint8_t>(variant);
+        chassis_cap.sdr_dev_addr = std::get<uint8_t>(variant);
 
         variant = ipmi::getDbusProperty(bus, chassisCapObject.second,
                                         chassisCapObject.first, chassisCapIntf,
                                         chassisSELDevAddrProp);
         // Chassis SEL Device Address.
-        chassis_cap.sel_dev_addr = variant_ns::get<uint8_t>(variant);
+        chassis_cap.sel_dev_addr = std::get<uint8_t>(variant);
 
         variant = ipmi::getDbusProperty(bus, chassisCapObject.second,
                                         chassisCapObject.first, chassisCapIntf,
                                         chassisSMDevAddrProp);
         // Chassis System Management Device Address.
-        chassis_cap.system_management_dev_addr =
-            variant_ns::get<uint8_t>(variant);
+        chassis_cap.system_management_dev_addr = std::get<uint8_t>(variant);
 
         variant = ipmi::getDbusProperty(bus, chassisCapObject.second,
                                         chassisCapObject.first, chassisCapIntf,
                                         chassisBridgeDevAddrProp);
         // Chassis Bridge Device Address.
-        chassis_cap.bridge_dev_addr = variant_ns::get<uint8_t>(variant);
+        chassis_cap.bridge_dev_addr = std::get<uint8_t>(variant);
         uint8_t* respP = reinterpret_cast<uint8_t*>(response);
         uint8_t* chassisP = reinterpret_cast<uint8_t*>(&chassis_cap);
         std::copy(chassisP, chassisP + *data_len, respP);
@@ -829,8 +826,8 @@
     }
     sdbusplus::message::variant<std::string> result;
     resp.read(result);
-    auto powerRestore = RestorePolicy::convertPolicyFromString(
-        variant_ns::get<std::string>(result));
+    auto powerRestore =
+        RestorePolicy::convertPolicyFromString(std::get<std::string>(result));
 
     *data_len = 4;
 
@@ -1366,8 +1363,8 @@
             }
             sdbusplus::message::variant<std::string> result;
             reply.read(result);
-            auto bootSource = Source::convertSourcesFromString(
-                variant_ns::get<std::string>(result));
+            auto bootSource =
+                Source::convertSourcesFromString(std::get<std::string>(result));
 
             bootSetting = settings::boot::setting(objects, bootModeIntf);
             const auto& bootModeSetting = std::get<settings::Path>(bootSetting);
@@ -1384,8 +1381,8 @@
                 return IPMI_CC_UNSPECIFIED_ERROR;
             }
             reply.read(result);
-            auto bootMode = Mode::convertModesFromString(
-                variant_ns::get<std::string>(result));
+            auto bootMode =
+                Mode::convertModesFromString(std::get<std::string>(result));
 
             bootOption = sourceDbusToIpmi.at(bootSource);
             if ((Mode::Modes::Regular == bootMode) &&
diff --git a/dcmihandler.cpp b/dcmihandler.cpp
index 3188585..edbca8f 100644
--- a/dcmihandler.cpp
+++ b/dcmihandler.cpp
@@ -54,7 +54,6 @@
 constexpr auto SENSOR_SCALE_PROP = "Scale";
 
 using namespace phosphor::logging;
-namespace variant_ns = sdbusplus::message::variant_ns;
 
 namespace dcmi
 {
@@ -89,7 +88,7 @@
     sdbusplus::message::variant<uint32_t> pcap;
     reply.read(pcap);
 
-    return variant_ns::get<uint32_t>(pcap);
+    return std::get<uint32_t>(pcap);
 }
 
 bool getPcapEnabled(sdbusplus::bus::bus& bus)
@@ -110,7 +109,7 @@
     sdbusplus::message::variant<bool> pcapEnabled;
     reply.read(pcapEnabled);
 
-    return variant_ns::get<bool>(pcapEnabled);
+    return std::get<bool>(pcapEnabled);
 }
 
 void setPcap(sdbusplus::bus::bus& bus, const uint32_t powerCap)
@@ -209,7 +208,7 @@
     sdbusplus::message::variant<std::string> assetTag;
     reply.read(assetTag);
 
-    return variant_ns::get<std::string>(assetTag);
+    return std::get<std::string>(assetTag);
 }
 
 void writeAssetTag(const std::string& assetTag)
@@ -244,7 +243,7 @@
     auto value = ipmi::getDbusProperty(bus, service, networkConfigObj,
                                        networkConfigIntf, hostNameProp);
 
-    return variant_ns::get<std::string>(value);
+    return std::get<std::string>(value);
 }
 
 bool getDHCPEnabled()
@@ -258,7 +257,7 @@
     auto value = ipmi::getDbusProperty(bus, service, ethernetObj.first,
                                        ethernetIntf, "DHCPEnabled");
 
-    return variant_ns::get<bool>(value);
+    return std::get<bool>(value);
 }
 
 bool getDHCPOption(std::string prop)
@@ -268,7 +267,7 @@
     auto service = ipmi::getService(bus, dhcpIntf, dhcpObj);
     auto value = ipmi::getDbusProperty(bus, service, dhcpObj, dhcpIntf, prop);
 
-    return variant_ns::get<bool>(value);
+    return std::get<bool>(value);
 }
 
 void setDHCPOption(std::string prop, bool value)
@@ -834,16 +833,15 @@
     sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
     auto result = ipmi::getAllDbusProperties(
         bus, dbusService, dbusPath, "xyz.openbmc_project.Sensor.Value");
-    auto temperature = sdbusplus::message::variant_ns::visit(
-        ipmi::VariantToDoubleVisitor(), result.at("Value"));
+    auto temperature =
+        std::visit(ipmi::VariantToDoubleVisitor(), result.at("Value"));
     double absTemp = std::abs(temperature);
 
     auto findFactor = result.find("Scale");
     double factor = 0.0;
     if (findFactor != result.end())
     {
-        factor = sdbusplus::message::variant_ns::visit(
-            ipmi::VariantToDoubleVisitor(), findFactor->second);
+        factor = std::visit(ipmi::VariantToDoubleVisitor(), findFactor->second);
     }
     double scale = std::pow(10, factor);
 
@@ -1084,8 +1082,8 @@
         // Read the sensor value and scale properties
         auto properties = ipmi::getAllDbusProperties(bus, service, objectPath,
                                                      SENSOR_VALUE_INTF);
-        auto value = variant_ns::get<int64_t>(properties[SENSOR_VALUE_PROP]);
-        auto scale = variant_ns::get<int64_t>(properties[SENSOR_SCALE_PROP]);
+        auto value = std::get<int64_t>(properties[SENSOR_VALUE_PROP]);
+        auto scale = std::get<int64_t>(properties[SENSOR_SCALE_PROP]);
 
         // Power reading needs to be scaled with the Scale value using the
         // formula Value * 10^Scale.
diff --git a/host-cmd-manager.cpp b/host-cmd-manager.cpp
index 9efb787..f3aba7f 100644
--- a/host-cmd-manager.cpp
+++ b/host-cmd-manager.cpp
@@ -33,7 +33,6 @@
     sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 
 namespace sdbusRule = sdbusplus::bus::match::rules;
-namespace variant_ns = sdbusplus::message::variant_ns;
 
 Manager::Manager(sdbusplus::bus::bus& bus) :
     bus(bus), timer(std::bind(&Manager::hostTimeout, this)),
@@ -183,7 +182,7 @@
     }
 
     auto& requestedState =
-        variant_ns::get<std::string>(properties.at(HOST_TRANS_PROP));
+        std::get<std::string>(properties.at(HOST_TRANS_PROP));
 
     if (server::Host::convertTransitionFromString(requestedState) ==
         server::Host::Transition::On)
diff --git a/libipmid/utils.cpp b/libipmid/utils.cpp
index 3ff79ed..b8ba9a7 100644
--- a/libipmid/utils.cpp
+++ b/libipmid/utils.cpp
@@ -15,7 +15,6 @@
 
 using namespace phosphor::logging;
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
-namespace variant_ns = sdbusplus::message::variant_ns;
 
 namespace network
 {
@@ -118,7 +117,7 @@
         objectInfo = std::make_pair(object.first, object.second.begin()->first);
 
         // if LinkLocalIP found look for Non-LinkLocalIP
-        if (ipmi::network::isLinkLocalIP(variant_ns::get<std::string>(variant)))
+        if (ipmi::network::isLinkLocalIP(std::get<std::string>(variant)))
         {
             continue;
         }
diff --git a/read_fru_data.cpp b/read_fru_data.cpp
index 1f99e20..1a1949d 100644
--- a/read_fru_data.cpp
+++ b/read_fru_data.cpp
@@ -17,8 +17,6 @@
 namespace fru
 {
 
-namespace variant_ns = sdbusplus::message::variant_ns;
-
 using namespace phosphor::logging;
 using InternalFailure =
     sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
@@ -140,9 +138,8 @@
                 if (iter != allProp.end())
                 {
                     data[properties.second.section].emplace(
-                        properties.first,
-                        std::move(variant_ns::get<std::string>(
-                            allProp[properties.first])));
+                        properties.first, std::move(std::get<std::string>(
+                                              allProp[properties.first])));
                 }
             }
         }
diff --git a/selutility.cpp b/selutility.cpp
index 97c2b2b..0d71a47 100644
--- a/selutility.cpp
+++ b/selutility.cpp
@@ -58,8 +58,7 @@
         elog<InternalFailure>();
     }
 
-    record.recordID = static_cast<uint16_t>(
-        sdbusplus::message::variant_ns::get<uint32_t>(iterId->second));
+    record.recordID = static_cast<uint16_t>(std::get<uint32_t>(iterId->second));
 
     // Read Timestamp from the log entry.
     static constexpr auto propTimeStamp = "Timestamp";
@@ -71,7 +70,7 @@
     }
 
     std::chrono::milliseconds chronoTimeStamp(
-        sdbusplus::message::variant_ns::get<uint64_t>(iterTimeStamp->second));
+        std::get<uint64_t>(iterTimeStamp->second));
     record.timeStamp = static_cast<uint32_t>(
         std::chrono::duration_cast<std::chrono::seconds>(chronoTimeStamp)
             .count());
@@ -100,7 +99,7 @@
     static constexpr auto deassertEvent = 0x80;
 
     // Evaluate if the event is assertion or deassertion event
-    if (sdbusplus::message::variant_ns::get<bool>(iterResolved->second))
+    if (std::get<bool>(iterResolved->second))
     {
         record.eventType = deassertEvent | iter->second.eventReadingType;
     }
@@ -142,7 +141,7 @@
     sdbusplus::message::variant<AssociationList> list;
     reply.read(list);
 
-    auto& assocs = sdbusplus::message::variant_ns::get<AssociationList>(list);
+    auto& assocs = std::get<AssociationList>(list);
 
     /*
      * Check if the log entry has any callout associations, if there is a
@@ -204,8 +203,7 @@
     sdbusplus::message::variant<uint64_t> timeStamp;
     reply.read(timeStamp);
 
-    std::chrono::milliseconds chronoTimeStamp(
-        sdbusplus::message::variant_ns::get<uint64_t>(timeStamp));
+    std::chrono::milliseconds chronoTimeStamp(std::get<uint64_t>(timeStamp));
 
     return std::chrono::duration_cast<std::chrono::seconds>(chronoTimeStamp);
 }
diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp
index 1de1540..76dad69 100644
--- a/sensordatahandler.cpp
+++ b/sensordatahandler.cpp
@@ -17,8 +17,6 @@
 namespace sensor
 {
 
-namespace variant_ns = sdbusplus::message::variant_ns;
-
 using namespace phosphor::logging;
 using InternalFailure =
     sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
@@ -340,8 +338,7 @@
                     {
                         return IPMI_CC_OK;
                     }
-                    result =
-                        result && variant_ns::get<bool>(value.second.assert);
+                    result = result && std::get<bool>(value.second.assert);
                     valid = true;
                 }
                 else if (deassertionSet.test(value.first))
@@ -351,8 +348,7 @@
                     {
                         return IPMI_CC_OK;
                     }
-                    result =
-                        result && variant_ns::get<bool>(value.second.deassert);
+                    result = result && std::get<bool>(value.second.deassert);
                     valid = true;
                 }
             }
@@ -361,13 +357,11 @@
             {
                 if (assertionSet.test(value.first))
                 {
-                    result =
-                        result && variant_ns::get<bool>(value.second.assert);
+                    result = result && std::get<bool>(value.second.assert);
                 }
                 else if (deassertionSet.test(value.first))
                 {
-                    result =
-                        result && variant_ns::get<bool>(value.second.deassert);
+                    result = result && std::get<bool>(value.second.deassert);
                 }
             }
             if (valid)
diff --git a/sensordatahandler.hpp b/sensordatahandler.hpp
index 6d80f9a..a7eadda 100644
--- a/sensordatahandler.hpp
+++ b/sensordatahandler.hpp
@@ -13,8 +13,6 @@
 namespace sensor
 {
 
-namespace variant_ns = sdbusplus::message::variant_ns;
-
 using Assertion = uint16_t;
 using Deassertion = uint16_t;
 using AssertionSet = std::pair<Assertion, Deassertion>;
@@ -166,7 +164,7 @@
         sensorInfo.propertyInterfaces.begin()->first,
         sensorInfo.propertyInterfaces.begin()->second.begin()->first);
 
-    setAssertionBytes(static_cast<uint16_t>(variant_ns::get<T>(propValue)),
+    setAssertionBytes(static_cast<uint16_t>(std::get<T>(propValue)),
                       responseData);
 
     return response;
@@ -197,7 +195,7 @@
         sensorInfo.propertyInterfaces.begin()->first,
         sensorInfo.propertyInterfaces.begin()->second.begin()->first);
 
-    double value = variant_ns::get<T>(propValue) *
+    double value = std::get<T>(propValue) *
                    std::pow(10, sensorInfo.scale - sensorInfo.exponentR);
 
     auto rawData = static_cast<uint8_t>((value - sensorInfo.scaledOffset) /
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 48546af..4c0fe01 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -32,8 +32,6 @@
 using InternalFailure =
     sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 
-namespace variant_ns = sdbusplus::message::variant_ns;
-
 void register_netfn_sen_functions() __attribute__((constructor));
 
 struct sensorTypemap_t
@@ -443,10 +441,10 @@
     auto warnThresholds = ipmi::getAllDbusProperties(
         bus, service, info.sensorPath, warningThreshIntf);
 
-    double warnLow = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
-                                       warnThresholds["WarningLow"]);
-    double warnHigh = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
-                                        warnThresholds["WarningHigh"]);
+    double warnLow = std::visit(ipmi::VariantToDoubleVisitor(),
+                                warnThresholds["WarningLow"]);
+    double warnHigh = std::visit(ipmi::VariantToDoubleVisitor(),
+                                 warnThresholds["WarningHigh"]);
 
     if (warnLow != 0)
     {
@@ -468,10 +466,10 @@
 
     auto critThresholds = ipmi::getAllDbusProperties(
         bus, service, info.sensorPath, criticalThreshIntf);
-    double critLow = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
-                                       critThresholds["CriticalLow"]);
-    double critHigh = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
-                                        critThresholds["CriticalHigh"]);
+    double critLow = std::visit(ipmi::VariantToDoubleVisitor(),
+                                critThresholds["CriticalLow"]);
+    double critHigh = std::visit(ipmi::VariantToDoubleVisitor(),
+                                 critThresholds["CriticalHigh"]);
 
     if (critLow != 0)
     {
diff --git a/settings.cpp b/settings.cpp
index e8b8997..a51fa95 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -11,7 +11,6 @@
 
 using namespace phosphor::logging;
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
-namespace variant_ns = sdbusplus::message::variant_ns;
 
 constexpr auto mapperService = "xyz.openbmc_project.ObjectMapper";
 constexpr auto mapperPath = "/xyz/openbmc_project/object_mapper";
@@ -132,7 +131,7 @@
 
     sdbusplus::message::variant<bool> enabled;
     reply.read(enabled);
-    auto oneTimeEnabled = variant_ns::get<bool>(enabled);
+    auto oneTimeEnabled = std::get<bool>(enabled);
     const Path& setting = oneTimeEnabled ? oneTimeSetting : regularSetting;
     return std::make_tuple(setting, oneTimeEnabled);
 }
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 18f1357..c225279 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -62,8 +62,6 @@
 
 } // namespace cache
 
-namespace variant_ns = sdbusplus::message::variant_ns;
-
 using InternalFailure =
     sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 using namespace phosphor::logging;
@@ -522,7 +520,7 @@
             return IPMI_CC_UNSPECIFIED_ERROR;
         }
         reply.read(value);
-        host_time_usec = variant_ns::get<uint64_t>(value);
+        host_time_usec = std::get<uint64_t>(value);
     }
     catch (InternalFailure& e)
     {
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 59d933a..d0768ac 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -36,7 +36,6 @@
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 
 namespace fs = std::filesystem;
-namespace variant_ns = sdbusplus::message::variant_ns;
 
 void register_netfn_transport_functions() __attribute__((constructor));
 
@@ -88,7 +87,7 @@
                             ipmi::network::IP_INTERFACE);
 
                         ipaddress =
-                            variant_ns::get<std::string>(properties["Address"]);
+                            std::get<std::string>(properties["Address"]);
                     }
                     // ignore the exception, as it is a valid condition that
                     // the system is not configured with any IP.
@@ -162,7 +161,7 @@
                         bus, ipmi::network::SERVICE, networkInterfacePath,
                         ipmi::network::ETHERNET_INTERFACE, "DHCPEnabled");
 
-                    auto dhcpEnabled = variant_ns::get<bool>(variant);
+                    auto dhcpEnabled = std::get<bool>(variant);
                     // As per IPMI spec 2=>DHCP, 1=STATIC
                     auto ipsrc = dhcpEnabled ? ipmi::network::IPOrigin::DHCP
                                              : ipmi::network::IPOrigin::STATIC;
@@ -192,8 +191,8 @@
                             bus, ipObjectInfo.second, ipObjectInfo.first,
                             ipmi::network::IP_INTERFACE);
 
-                        auto prefix = variant_ns::get<uint8_t>(
-                            properties["PrefixLength"]);
+                        auto prefix =
+                            std::get<uint8_t>(properties["PrefixLength"]);
                         mask = ipmi::network::MASK_32_BIT;
                         mask = htonl(mask << (ipmi::network::BITS_32 - prefix));
                     }
@@ -230,7 +229,7 @@
                             bus, systemObject.second, systemObject.first,
                             ipmi::network::SYSTEMCONFIG_INTERFACE);
 
-                        gateway = variant_ns::get<std::string>(
+                        gateway = std::get<std::string>(
                             systemProperties["DefaultGateway"]);
                     }
                     // ignore the exception, as it is a valid condition that
@@ -263,7 +262,7 @@
                         bus, macObjectInfo.second, macObjectInfo.first,
                         ipmi::network::MAC_INTERFACE, "MACAddress");
 
-                    macAddress = variant_ns::get<std::string>(variant);
+                    macAddress = std::get<std::string>(variant);
                 }
                 else if (channelConf->lan_set_in_progress == SET_IN_PROGRESS)
                 {
@@ -799,7 +798,7 @@
             }
 
             // get the configured mode on the system.
-            auto enableDHCP = variant_ns::get<bool>(ipmi::getDbusProperty(
+            auto enableDHCP = std::get<bool>(ipmi::getDbusProperty(
                 bus, ipmi::network::SERVICE, networkInterfacePath,
                 ipmi::network::ETHERNET_INTERFACE, "DHCPEnabled"));
 
@@ -843,14 +842,13 @@
                         bus, ipObject.second, ipObject.first,
                         ipmi::network::IP_INTERFACE);
 
-                    ipaddress = channelConf->ipaddr.empty()
-                                    ? variant_ns::get<std::string>(
-                                          properties["Address"])
-                                    : channelConf->ipaddr;
+                    ipaddress =
+                        channelConf->ipaddr.empty()
+                            ? std::get<std::string>(properties["Address"])
+                            : channelConf->ipaddr;
 
                     prefix = channelConf->netmask.empty()
-                                 ? variant_ns::get<uint8_t>(
-                                       properties["PrefixLength"])
+                                 ? std::get<uint8_t>(properties["PrefixLength"])
                                  : ipmi::network::toPrefix(
                                        AF_INET, channelConf->netmask);
                 }
@@ -867,7 +865,7 @@
                     ipmi::network::SYSTEMCONFIG_INTERFACE);
 
                 gateway = channelConf->gateway.empty()
-                              ? variant_ns::get<std::string>(
+                              ? std::get<std::string>(
                                     systemProperties["DefaultGateway"])
                               : channelConf->gateway;
             }
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 3fb19b2..6be7d9a 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -34,7 +34,6 @@
 namespace ipmi
 {
 
-namespace variant_ns = sdbusplus::message::variant_ns;
 using namespace phosphor::logging;
 
 static constexpr const char* channelAccessDefaultFilename =
@@ -204,7 +203,7 @@
         if (prop.first == privilegePropertyString)
         {
             propName = privilegePropertyString;
-            intfPrivStr = variant_ns::get<std::string>(prop.second);
+            intfPrivStr = std::get<std::string>(prop.second);
             break;
         }
     }
@@ -1309,9 +1308,9 @@
                                             channelData[chNum].chName.c_str()));
                     continue;
                 }
-                intfPrivStr = variant_ns::get<std::string>(variant);
+                intfPrivStr = std::get<std::string>(variant);
             }
-            catch (const variant_ns::bad_variant_access& e)
+            catch (const std::bad_variant_access& e)
             {
                 log<level::DEBUG>(
                     "exception: Network interface does not exist");
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index f0cd7ad..6f4a79f 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -103,8 +103,6 @@
     "priv-custom"    // PRIVILEGE_OEM - 5
 };
 
-namespace variant_ns = sdbusplus::message::variant_ns;
-
 using namespace phosphor::logging;
 using Json = nlohmann::json;
 
@@ -376,17 +374,17 @@
             std::string member = prop.first;
             if (member == userPrivProperty)
             {
-                priv = variant_ns::get<std::string>(prop.second);
+                priv = std::get<std::string>(prop.second);
                 userEvent = UserUpdateEvent::userPrivUpdated;
             }
             else if (member == userGrpProperty)
             {
-                groups = variant_ns::get<std::vector<std::string>>(prop.second);
+                groups = std::get<std::vector<std::string>>(prop.second);
                 userEvent = UserUpdateEvent::userGrpUpdated;
             }
             else if (member == userEnabledProperty)
             {
-                enabled = variant_ns::get<bool>(prop.second);
+                enabled = std::get<bool>(prop.second);
                 userEvent = UserUpdateEvent::userStateUpdated;
             }
             // Process based on event type.
@@ -1252,13 +1250,11 @@
         auto key = t.first;
         if (key == allPrivProperty)
         {
-            availablePrivileges =
-                variant_ns::get<std::vector<std::string>>(t.second);
+            availablePrivileges = std::get<std::vector<std::string>>(t.second);
         }
         else if (key == allGrpProperty)
         {
-            availableGroups =
-                variant_ns::get<std::vector<std::string>>(t.second);
+            availableGroups = std::get<std::vector<std::string>>(t.second);
         }
     }
     // TODO: Implement Supported Privilege & Groups verification logic
@@ -1285,15 +1281,15 @@
         std::string key = t.first;
         if (key == userPrivProperty)
         {
-            usrPriv = variant_ns::get<std::string>(t.second);
+            usrPriv = std::get<std::string>(t.second);
         }
         else if (key == userGrpProperty)
         {
-            usrGrps = variant_ns::get<std::vector<std::string>>(t.second);
+            usrGrps = std::get<std::vector<std::string>>(t.second);
         }
         else if (key == userEnabledProperty)
         {
-            usrEnabled = variant_ns::get<bool>(t.second);
+            usrEnabled = std::get<bool>(t.second);
         }
     }
     return;
