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;
