diff --git a/command/payload_cmds.cpp b/command/payload_cmds.cpp
index c8e682e..bc987c5 100644
--- a/command/payload_cmds.cpp
+++ b/command/payload_cmds.cpp
@@ -41,6 +41,9 @@
         return outPayload;
     }
 
+    std::get<sol::Manager&>(singletonPool)
+        .updateSOLParameter(ipmi::convertCurrentChannelNum(
+            ipmi::currentChNum, getInterfaceIndex()));
     if (!std::get<sol::Manager&>(singletonPool).enable)
     {
         response->completionCode = IPMI_CC_PAYLOAD_TYPE_DISABLED;
diff --git a/command/sol_cmds.cpp b/command/sol_cmds.cpp
index fda3e91..a1e820f 100644
--- a/command/sol_cmds.cpp
+++ b/command/sol_cmds.cpp
@@ -71,90 +71,6 @@
                                           outPayload);
 }
 
-std::vector<uint8_t> setConfParams(const std::vector<uint8_t>& inPayload,
-                                   const message::Handler& handler)
-{
-    std::vector<uint8_t> outPayload(sizeof(SetConfParamsResponse));
-    auto request =
-        reinterpret_cast<const SetConfParamsRequest*>(inPayload.data());
-    auto response = reinterpret_cast<SetConfParamsResponse*>(outPayload.data());
-    response->completionCode = IPMI_CC_OK;
-
-    switch (static_cast<Parameter>(request->paramSelector))
-    {
-        case Parameter::PROGRESS:
-        {
-            uint8_t progress = request->value & progressMask;
-            std::get<sol::Manager&>(singletonPool).progress = progress;
-            break;
-        }
-        case Parameter::ENABLE:
-        {
-            bool enable = request->value & enableMask;
-            std::get<sol::Manager&>(singletonPool).enable = enable;
-            break;
-        }
-        case Parameter::AUTHENTICATION:
-        {
-            if (!request->auth.auth || !request->auth.encrypt)
-            {
-                response->completionCode = ipmiCCWriteReadParameter;
-            }
-            else if (request->auth.privilege <
-                         static_cast<uint8_t>(session::Privilege::USER) ||
-                     request->auth.privilege >
-                         static_cast<uint8_t>(session::Privilege::OEM))
-            {
-                response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
-            }
-            else
-            {
-                std::get<sol::Manager&>(singletonPool).solMinPrivilege =
-                    static_cast<session::Privilege>(request->auth.privilege);
-            }
-            break;
-        }
-        case Parameter::ACCUMULATE:
-        {
-            using namespace std::chrono_literals;
-
-            if (request->acc.threshold == 0)
-            {
-                response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
-                break;
-            }
-
-            std::get<sol::Manager&>(singletonPool).accumulateInterval =
-                request->acc.interval * sol::accIntervalFactor * 1ms;
-            std::get<sol::Manager&>(singletonPool).sendThreshold =
-                request->acc.threshold;
-            break;
-        }
-        case Parameter::RETRY:
-        {
-            using namespace std::chrono_literals;
-
-            std::get<sol::Manager&>(singletonPool).retryCount =
-                request->retry.count;
-            std::get<sol::Manager&>(singletonPool).retryInterval =
-                request->retry.interval * sol::retryIntervalFactor * 1ms;
-            break;
-        }
-        case Parameter::PORT:
-        {
-            response->completionCode = ipmiCCWriteReadParameter;
-            break;
-        }
-        case Parameter::NVBITRATE:
-        case Parameter::VBITRATE:
-        case Parameter::CHANNEL:
-        default:
-            response->completionCode = ipmiCCParamNotSupported;
-    }
-
-    return outPayload;
-}
-
 std::vector<uint8_t> getConfParams(const std::vector<uint8_t>& inPayload,
                                    const message::Handler& handler)
 {
