diff --git a/user_channel/channel_layer.cpp b/user_channel/channel_layer.cpp
index 32f4ded..ae23f3f 100644
--- a/user_channel/channel_layer.cpp
+++ b/user_channel/channel_layer.cpp
@@ -23,7 +23,7 @@
 namespace ipmi
 {
 
-bool doesDeviceExist(const uint8_t& chNum)
+bool doesDeviceExist(const uint8_t chNum)
 {
     // TODO: This is not the reliable way to find the device
     // associated with ethernet interface as the channel number to
@@ -42,34 +42,34 @@
     return true;
 }
 
-bool isValidPrivLimit(const uint8_t& privLimit)
+bool isValidPrivLimit(const uint8_t privLimit)
 {
     return ((privLimit >= PRIVILEGE_CALLBACK) && (privLimit <= PRIVILEGE_OEM));
 }
 
-bool isValidAccessMode(const uint8_t& accessMode)
+bool isValidAccessMode(const uint8_t accessMode)
 {
     return (
         (accessMode >= static_cast<uint8_t>(EChannelAccessMode::disabled)) &&
         (accessMode <= static_cast<uint8_t>(EChannelAccessMode::shared)));
 }
 
-bool isValidChannel(const uint8_t& chNum)
+bool isValidChannel(const uint8_t chNum)
 {
     return getChannelConfigObject().isValidChannel(chNum);
 }
 
-bool isValidAuthType(const uint8_t& chNum, const EAuthType& authType)
+bool isValidAuthType(const uint8_t chNum, const EAuthType& authType)
 {
     return getChannelConfigObject().isValidAuthType(chNum, authType);
 }
 
-EChannelSessSupported getChannelSessionSupport(const uint8_t& chNum)
+EChannelSessSupported getChannelSessionSupport(const uint8_t chNum)
 {
     return getChannelConfigObject().getChannelSessionSupport(chNum);
 }
 
-int getChannelActiveSessions(const uint8_t& chNum)
+int getChannelActiveSessions(const uint8_t chNum)
 {
     return getChannelConfigObject().getChannelActiveSessions(chNum);
 }
@@ -80,48 +80,48 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t getChannelInfo(const uint8_t& chNum, ChannelInfo& chInfo)
+ipmi_ret_t getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo)
 {
     return getChannelConfigObject().getChannelInfo(chNum, chInfo);
 }
 
-ipmi_ret_t getChannelAccessData(const uint8_t& chNum,
+ipmi_ret_t getChannelAccessData(const uint8_t chNum,
                                 ChannelAccess& chAccessData)
 {
     return getChannelConfigObject().getChannelAccessData(chNum, chAccessData);
 }
 
-ipmi_ret_t setChannelAccessData(const uint8_t& chNum,
+ipmi_ret_t setChannelAccessData(const uint8_t chNum,
                                 const ChannelAccess& chAccessData,
-                                const uint8_t& setFlag)
+                                const uint8_t setFlag)
 {
     return getChannelConfigObject().setChannelAccessData(chNum, chAccessData,
                                                          setFlag);
 }
 
-ipmi_ret_t getChannelAccessPersistData(const uint8_t& chNum,
+ipmi_ret_t getChannelAccessPersistData(const uint8_t chNum,
                                        ChannelAccess& chAccessData)
 {
     return getChannelConfigObject().getChannelAccessPersistData(chNum,
                                                                 chAccessData);
 }
 
-ipmi_ret_t setChannelAccessPersistData(const uint8_t& chNum,
+ipmi_ret_t setChannelAccessPersistData(const uint8_t chNum,
                                        const ChannelAccess& chAccessData,
-                                       const uint8_t& setFlag)
+                                       const uint8_t setFlag)
 {
     return getChannelConfigObject().setChannelAccessPersistData(
         chNum, chAccessData, setFlag);
 }
 
-ipmi_ret_t getChannelAuthTypeSupported(const uint8_t& chNum,
+ipmi_ret_t getChannelAuthTypeSupported(const uint8_t chNum,
                                        uint8_t& authTypeSupported)
 {
     return getChannelConfigObject().getChannelAuthTypeSupported(
         chNum, authTypeSupported);
 }
 
-ipmi_ret_t getChannelEnabledAuthType(const uint8_t& chNum, const uint8_t& priv,
+ipmi_ret_t getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
                                      EAuthType& authType)
 {
     return getChannelConfigObject().getChannelEnabledAuthType(chNum, priv,
diff --git a/user_channel/channel_layer.hpp b/user_channel/channel_layer.hpp
index fa15378..3a9b5f5 100644
--- a/user_channel/channel_layer.hpp
+++ b/user_channel/channel_layer.hpp
@@ -142,7 +142,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool isValidChannel(const uint8_t& chNum);
+bool isValidChannel(const uint8_t chNum);
 
 /** @brief determines whether channel device exist
  *
@@ -150,7 +150,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool doesDeviceExist(const uint8_t& chNum);
+bool doesDeviceExist(const uint8_t chNum);
 
 /** @brief determines whether privilege limit is valid
  *
@@ -158,7 +158,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool isValidPrivLimit(const uint8_t& privLimit);
+bool isValidPrivLimit(const uint8_t privLimit);
 
 /** @brief determines whether access mode  is valid
  *
@@ -166,7 +166,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool isValidAccessMode(const uint8_t& accessMode);
+bool isValidAccessMode(const uint8_t accessMode);
 
 /** @brief determines valid authentication type based on channel number
  *
@@ -175,7 +175,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool isValidAuthType(const uint8_t& chNum, const EAuthType& authType);
+bool isValidAuthType(const uint8_t chNum, const EAuthType& authType);
 
 /** @brief determines supported session type of a channel
  *
@@ -183,7 +183,7 @@
  *
  *  @return EChannelSessSupported - supported session type
  */
-EChannelSessSupported getChannelSessionSupport(const uint8_t& chNum);
+EChannelSessSupported getChannelSessionSupport(const uint8_t chNum);
 
 /** @brief determines number of active sessions on a channel
  *
@@ -191,7 +191,7 @@
  *
  *  @return numer of active sessions
  */
-int getChannelActiveSessions(const uint8_t& chNum);
+int getChannelActiveSessions(const uint8_t chNum);
 
 /** @brief initializes channel management
  *
@@ -206,7 +206,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t getChannelInfo(const uint8_t& chNum, ChannelInfo& chInfo);
+ipmi_ret_t getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo);
 
 /** @brief provides channel access data
  *
@@ -215,7 +215,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t getChannelAccessData(const uint8_t& chNum,
+ipmi_ret_t getChannelAccessData(const uint8_t chNum,
                                 ChannelAccess& chAccessData);
 
 /** @brief to set channel access data
@@ -226,9 +226,9 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t setChannelAccessData(const uint8_t& chNum,
+ipmi_ret_t setChannelAccessData(const uint8_t chNum,
                                 const ChannelAccess& chAccessData,
-                                const uint8_t& setFlag);
+                                const uint8_t setFlag);
 
 /** @brief to get channel access data persistent data
  *
@@ -237,7 +237,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t getChannelAccessPersistData(const uint8_t& chNum,
+ipmi_ret_t getChannelAccessPersistData(const uint8_t chNum,
                                        ChannelAccess& chAccessData);
 
 /** @brief to set channel access data persistent data
@@ -248,9 +248,9 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t setChannelAccessPersistData(const uint8_t& chNum,
+ipmi_ret_t setChannelAccessPersistData(const uint8_t chNum,
                                        const ChannelAccess& chAccessData,
-                                       const uint8_t& setFlag);
+                                       const uint8_t setFlag);
 
 /** @brief provides supported authentication type for the channel
  *
@@ -259,7 +259,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t getChannelAuthTypeSupported(const uint8_t& chNum,
+ipmi_ret_t getChannelAuthTypeSupported(const uint8_t chNum,
                                        uint8_t& authTypeSupported);
 
 /** @brief provides enabled authentication type for the channel
@@ -270,7 +270,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t getChannelEnabledAuthType(const uint8_t& chNum, const uint8_t& priv,
+ipmi_ret_t getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
                                      EAuthType& authType);
 
 } // namespace ipmi
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 14b350e..7d93e0d 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -358,14 +358,14 @@
     }
 }
 
-ChannelData* ChannelConfig::getChannelDataPtr(const uint8_t& chNum)
+ChannelData* ChannelConfig::getChannelDataPtr(const uint8_t chNum)
 {
     // reload data before using it.
     checkAndReloadVolatileData();
     return &channelData[chNum];
 }
 
-bool ChannelConfig::isValidChannel(const uint8_t& chNum)
+bool ChannelConfig::isValidChannel(const uint8_t chNum)
 {
     if (chNum > maxIpmiChannels)
     {
@@ -383,14 +383,14 @@
 }
 
 EChannelSessSupported
-    ChannelConfig::getChannelSessionSupport(const uint8_t& chNum)
+    ChannelConfig::getChannelSessionSupport(const uint8_t chNum)
 {
     EChannelSessSupported chSessSupport =
         (EChannelSessSupported)channelData[chNum].chInfo.sessionSupported;
     return chSessSupport;
 }
 
-bool ChannelConfig::isValidAuthType(const uint8_t& chNum,
+bool ChannelConfig::isValidAuthType(const uint8_t chNum,
                                     const EAuthType& authType)
 {
     if ((authType < EAuthType::md2) || (authType > EAuthType::oem))
@@ -409,7 +409,7 @@
     return true;
 }
 
-int ChannelConfig::getChannelActiveSessions(const uint8_t& chNum)
+int ChannelConfig::getChannelActiveSessions(const uint8_t chNum)
 {
     // TODO: TEMPORARY FIX
     // Channels active session count is managed separatly
@@ -419,7 +419,7 @@
     return channelData[chNum].activeSessCount;
 }
 
-ipmi_ret_t ChannelConfig::getChannelInfo(const uint8_t& chNum,
+ipmi_ret_t ChannelConfig::getChannelInfo(const uint8_t chNum,
                                          ChannelInfo& chInfo)
 {
     if (!isValidChannel(chNum))
@@ -435,7 +435,7 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t ChannelConfig::getChannelAccessData(const uint8_t& chNum,
+ipmi_ret_t ChannelConfig::getChannelAccessData(const uint8_t chNum,
                                                ChannelAccess& chAccessData)
 {
     if (!isValidChannel(chNum))
@@ -464,9 +464,9 @@
 }
 
 ipmi_ret_t
-    ChannelConfig::setChannelAccessData(const uint8_t& chNum,
+    ChannelConfig::setChannelAccessData(const uint8_t chNum,
                                         const ChannelAccess& chAccessData,
-                                        const uint8_t& setFlag)
+                                        const uint8_t setFlag)
 {
     if (!isValidChannel(chNum))
     {
@@ -531,7 +531,7 @@
 }
 
 ipmi_ret_t
-    ChannelConfig::getChannelAccessPersistData(const uint8_t& chNum,
+    ChannelConfig::getChannelAccessPersistData(const uint8_t chNum,
                                                ChannelAccess& chAccessData)
 {
     if (!isValidChannel(chNum))
@@ -560,8 +560,8 @@
 }
 
 ipmi_ret_t ChannelConfig::setChannelAccessPersistData(
-    const uint8_t& chNum, const ChannelAccess& chAccessData,
-    const uint8_t& setFlag)
+    const uint8_t chNum, const ChannelAccess& chAccessData,
+    const uint8_t setFlag)
 {
     if (!isValidChannel(chNum))
     {
@@ -648,7 +648,7 @@
 }
 
 ipmi_ret_t
-    ChannelConfig::getChannelAuthTypeSupported(const uint8_t& chNum,
+    ChannelConfig::getChannelAuthTypeSupported(const uint8_t chNum,
                                                uint8_t& authTypeSupported)
 {
     if (!isValidChannel(chNum))
@@ -661,8 +661,8 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t ChannelConfig::getChannelEnabledAuthType(const uint8_t& chNum,
-                                                    const uint8_t& priv,
+ipmi_ret_t ChannelConfig::getChannelEnabledAuthType(const uint8_t chNum,
+                                                    const uint8_t priv,
                                                     EAuthType& authType)
 {
     if (!isValidChannel(chNum))
@@ -715,7 +715,7 @@
         std::distance(accessModeList.begin(), iter));
 }
 
-std::string ChannelConfig::convertToAccessModeString(const uint8_t& value)
+std::string ChannelConfig::convertToAccessModeString(const uint8_t value)
 {
     if (accessModeList.size() <= value)
     {
@@ -740,7 +740,7 @@
     return static_cast<CommandPrivilege>(std::distance(privList.begin(), iter));
 }
 
-std::string ChannelConfig::convertToPrivLimitString(const uint8_t& value)
+std::string ChannelConfig::convertToPrivLimitString(const uint8_t value)
 {
     if (privList.size() <= value)
     {
@@ -797,7 +797,7 @@
     return static_cast<EChannelProtocolType>(it->second);
 }
 
-uint8_t ChannelConfig::convertToChannelIndexNumber(const uint8_t& chNum)
+uint8_t ChannelConfig::convertToChannelIndexNumber(const uint8_t chNum)
 {
 
     // TODO: There is limitation in current design. we cannot detect exact
@@ -884,7 +884,7 @@
     return 0;
 }
 
-void ChannelConfig::setDefaultChannelConfig(const uint8_t& chNum,
+void ChannelConfig::setDefaultChannelConfig(const uint8_t chNum,
                                             const std::string& chName)
 {
     channelData[chNum].chName = chName;
diff --git a/user_channel/channel_mgmt.hpp b/user_channel/channel_mgmt.hpp
index 5c35041..09d2a71 100644
--- a/user_channel/channel_mgmt.hpp
+++ b/user_channel/channel_mgmt.hpp
@@ -75,7 +75,7 @@
      *
      *  @return true if valid, false otherwise
      */
-    bool isValidChannel(const uint8_t& chNum);
+    bool isValidChannel(const uint8_t chNum);
 
     /** @brief determines valid authentication type
      *
@@ -84,7 +84,7 @@
      *
      *  @return true if valid, false otherwise
      */
-    bool isValidAuthType(const uint8_t& chNum, const EAuthType& authType);
+    bool isValidAuthType(const uint8_t chNum, const EAuthType& authType);
 
     /** @brief determines supported session type of a channel
      *
@@ -92,7 +92,7 @@
      *
      *  @return EChannelSessSupported - supported session type
      */
-    EChannelSessSupported getChannelSessionSupport(const uint8_t& chNum);
+    EChannelSessSupported getChannelSessionSupport(const uint8_t chNum);
 
     /** @brief determines number of active sessions on a channel
      *
@@ -100,7 +100,7 @@
      *
      *  @return numer of active sessions
      */
-    int getChannelActiveSessions(const uint8_t& chNum);
+    int getChannelActiveSessions(const uint8_t chNum);
 
     /** @brief provides channel info details
      *
@@ -109,7 +109,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t getChannelInfo(const uint8_t& chNum, ChannelInfo& chInfo);
+    ipmi_ret_t getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo);
 
     /** @brief provides channel access data
      *
@@ -118,7 +118,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t getChannelAccessData(const uint8_t& chNum,
+    ipmi_ret_t getChannelAccessData(const uint8_t chNum,
                                     ChannelAccess& chAccessData);
 
     /** @brief to set channel access data
@@ -129,9 +129,9 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t setChannelAccessData(const uint8_t& chNum,
+    ipmi_ret_t setChannelAccessData(const uint8_t chNum,
                                     const ChannelAccess& chAccessData,
-                                    const uint8_t& setFlag);
+                                    const uint8_t setFlag);
 
     /** @brief to get channel access data persistent data
      *
@@ -140,7 +140,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t getChannelAccessPersistData(const uint8_t& chNum,
+    ipmi_ret_t getChannelAccessPersistData(const uint8_t chNum,
                                            ChannelAccess& chAccessData);
 
     /** @brief to set channel access data persistent data
@@ -151,9 +151,9 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t setChannelAccessPersistData(const uint8_t& chNum,
+    ipmi_ret_t setChannelAccessPersistData(const uint8_t chNum,
                                            const ChannelAccess& chAccessData,
-                                           const uint8_t& setFlag);
+                                           const uint8_t setFlag);
 
     /** @brief provides supported authentication type for the channel
      *
@@ -162,7 +162,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t getChannelAuthTypeSupported(const uint8_t& chNum,
+    ipmi_ret_t getChannelAuthTypeSupported(const uint8_t chNum,
                                            uint8_t& authTypeSupported);
 
     /** @brief provides enabled authentication type for the channel
@@ -173,8 +173,8 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t getChannelEnabledAuthType(const uint8_t& chNum,
-                                         const uint8_t& priv,
+    ipmi_ret_t getChannelEnabledAuthType(const uint8_t chNum,
+                                         const uint8_t priv,
                                          EAuthType& authType);
 
     /** @brief conver to channel privilege from system privilege
@@ -203,7 +203,7 @@
      *
      *  @return 0 for success, -errno for failure.
      */
-    ChannelData* getChannelDataPtr(const uint8_t& chNum);
+    ChannelData* getChannelDataPtr(const uint8_t chNum);
 
     uint32_t signalFlag = 0;
 
@@ -231,7 +231,7 @@
      *  @param[in] chNum - channel number
      *  @param[in] chName - channel name
      */
-    void setDefaultChannelConfig(const uint8_t& chNum,
+    void setDefaultChannelConfig(const uint8_t chNum,
                                  const std::string& chName);
 
     /** @brief function to load all channel configuration
@@ -335,7 +335,7 @@
      *
      *  @return access mode in string
      */
-    std::string convertToAccessModeString(const uint8_t& value);
+    std::string convertToAccessModeString(const uint8_t value);
 
     /** @brief function to convert privilege value to string
      *
@@ -343,7 +343,7 @@
      *
      *  @return privilege in string
      */
-    std::string convertToPrivLimitString(const uint8_t& value);
+    std::string convertToPrivLimitString(const uint8_t value);
 
     /** @brief function to convert session support string to value type
      *
@@ -376,7 +376,7 @@
      *
      *  @return channel index
      */
-    uint8_t convertToChannelIndexNumber(const uint8_t& chNum);
+    uint8_t convertToChannelIndexNumber(const uint8_t chNum);
 
     /** @brief function to convert channel name to network interface name
      *
diff --git a/user_channel/user_layer.cpp b/user_channel/user_layer.cpp
index 5a4d7ad..30aa12c 100644
--- a/user_channel/user_layer.cpp
+++ b/user_channel/user_layer.cpp
@@ -57,17 +57,17 @@
     return IPMI_CC_OK;
 }
 
-bool ipmiUserIsValidUserId(const uint8_t& userId)
+bool ipmiUserIsValidUserId(const uint8_t userId)
 {
     return UserAccess::isValidUserId(userId);
 }
 
-bool ipmiUserIsValidChannel(const uint8_t& chNum)
+bool ipmiUserIsValidChannel(const uint8_t chNum)
 {
     return UserAccess::isValidChannel(chNum);
 }
 
-bool ipmiUserIsValidPrivilege(const uint8_t& priv)
+bool ipmiUserIsValidPrivilege(const uint8_t priv)
 {
     return UserAccess::isValidPrivilege(priv);
 }
@@ -77,12 +77,12 @@
     return getUserAccessObject().getUserId(userName);
 }
 
-ipmi_ret_t ipmiUserSetUserName(const uint8_t& userId, const char* userName)
+ipmi_ret_t ipmiUserSetUserName(const uint8_t userId, const char* userName)
 {
     return getUserAccessObject().setUserName(userId, userName);
 }
 
-ipmi_ret_t ipmiUserGetUserName(const uint8_t& userId, std::string& userName)
+ipmi_ret_t ipmiUserGetUserName(const uint8_t userId, std::string& userName)
 {
     return getUserAccessObject().getUserName(userId, userName);
 }
@@ -109,12 +109,12 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t ipmiUserUpdateEnabledState(const uint8_t& userId, const bool& state)
+ipmi_ret_t ipmiUserUpdateEnabledState(const uint8_t userId, const bool& state)
 {
     return getUserAccessObject().setUserEnabledState(userId, state);
 }
 
-ipmi_ret_t ipmiUserCheckEnabled(const uint8_t& userId, bool& state)
+ipmi_ret_t ipmiUserCheckEnabled(const uint8_t userId, bool& state)
 {
     if (!UserAccess::isValidUserId(userId))
     {
@@ -125,8 +125,7 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t ipmiUserGetPrivilegeAccess(const uint8_t& userId,
-                                      const uint8_t& chNum,
+ipmi_ret_t ipmiUserGetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
                                       PrivAccess& privAccess)
 {
 
@@ -148,8 +147,7 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t ipmiUserSetPrivilegeAccess(const uint8_t& userId,
-                                      const uint8_t& chNum,
+ipmi_ret_t ipmiUserSetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
                                       const PrivAccess& privAccess,
                                       const bool& otherPrivUpdates)
 {
diff --git a/user_channel/user_layer.hpp b/user_channel/user_layer.hpp
index 8c81188..956c925 100644
--- a/user_channel/user_layer.hpp
+++ b/user_channel/user_layer.hpp
@@ -91,7 +91,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool ipmiUserIsValidUserId(const uint8_t& userId);
+bool ipmiUserIsValidUserId(const uint8_t userId);
 
 /** @brief determines valid channel
  *
@@ -99,7 +99,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool ipmiUserIsValidChannel(const uint8_t& chNum);
+bool ipmiUserIsValidChannel(const uint8_t chNum);
 
 /** @brief determines valid privilege level
  *
@@ -107,7 +107,7 @@
  *
  *  @return true if valid, false otherwise
  */
-bool ipmiUserIsValidPrivilege(const uint8_t& priv);
+bool ipmiUserIsValidPrivilege(const uint8_t priv);
 
 /** @brief get user id corresponding to the user name
  *
@@ -124,7 +124,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t ipmiUserSetUserName(const uint8_t& userId, const char* userName);
+ipmi_ret_t ipmiUserSetUserName(const uint8_t userId, const char* userName);
 
 /** @brief get user name
  *
@@ -133,7 +133,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t ipmiUserGetUserName(const uint8_t& userId, std::string& userName);
+ipmi_ret_t ipmiUserGetUserName(const uint8_t userId, std::string& userName);
 
 /** @brief provides available fixed, max, and enabled user counts
  *
@@ -153,7 +153,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t ipmiUserUpdateEnabledState(const uint8_t& userId, const bool& state);
+ipmi_ret_t ipmiUserUpdateEnabledState(const uint8_t userId, const bool& state);
 
 /** @brief determines whether user is enabled
  *
@@ -162,7 +162,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t ipmiUserCheckEnabled(const uint8_t& userId, bool& state);
+ipmi_ret_t ipmiUserCheckEnabled(const uint8_t userId, bool& state);
 
 /** @brief provides user privilege access data
  *
@@ -172,8 +172,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t ipmiUserGetPrivilegeAccess(const uint8_t& userId,
-                                      const uint8_t& chNum,
+ipmi_ret_t ipmiUserGetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
                                       PrivAccess& privAccess);
 
 /** @brief sets user privilege access data
@@ -185,8 +184,7 @@
  *
  *  @return IPMI_CC_OK for success, others for failure.
  */
-ipmi_ret_t ipmiUserSetPrivilegeAccess(const uint8_t& userId,
-                                      const uint8_t& chNum,
+ipmi_ret_t ipmiUserSetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
                                       const PrivAccess& privAccess,
                                       const bool& otherPrivUpdate);
 
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index af72540..8ba4a94 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -508,13 +508,13 @@
     }
 }
 
-UserInfo* UserAccess::getUserInfo(const uint8_t& userId)
+UserInfo* UserAccess::getUserInfo(const uint8_t userId)
 {
     checkAndReloadUserData();
     return &usersTbl.user[userId];
 }
 
-void UserAccess::setUserInfo(const uint8_t& userId, UserInfo* userInfo)
+void UserAccess::setUserInfo(const uint8_t userId, UserInfo* userInfo)
 {
     checkAndReloadUserData();
     std::copy(reinterpret_cast<uint8_t*>(userInfo),
@@ -523,17 +523,17 @@
     writeUserData();
 }
 
-bool UserAccess::isValidChannel(const uint8_t& chNum)
+bool UserAccess::isValidChannel(const uint8_t chNum)
 {
     return (chNum < ipmiMaxChannels);
 }
 
-bool UserAccess::isValidUserId(const uint8_t& userId)
+bool UserAccess::isValidUserId(const uint8_t userId)
 {
     return ((userId <= ipmiMaxUsers) && (userId != reservedUserId));
 }
 
-bool UserAccess::isValidPrivilege(const uint8_t& priv)
+bool UserAccess::isValidPrivilege(const uint8_t priv)
 {
     return ((priv >= PRIVILEGE_CALLBACK && priv <= PRIVILEGE_OEM) ||
             priv == privNoAccess);
@@ -633,7 +633,7 @@
     return true;
 }
 
-ipmi_ret_t UserAccess::setUserEnabledState(const uint8_t& userId,
+ipmi_ret_t UserAccess::setUserEnabledState(const uint8_t userId,
                                            const bool& enabledState)
 {
     if (!isValidUserId(userId))
@@ -660,8 +660,8 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t UserAccess::setUserPrivilegeAccess(const uint8_t& userId,
-                                              const uint8_t& chNum,
+ipmi_ret_t UserAccess::setUserPrivilegeAccess(const uint8_t userId,
+                                              const uint8_t chNum,
                                               const UserPrivAccess& privAccess,
                                               const bool& otherPrivUpdates)
 {
@@ -747,7 +747,7 @@
     return usrIndex;
 }
 
-ipmi_ret_t UserAccess::getUserName(const uint8_t& userId, std::string& userName)
+ipmi_ret_t UserAccess::getUserName(const uint8_t userId, std::string& userName)
 {
     if (!isValidUserId(userId))
     {
@@ -759,7 +759,7 @@
     return IPMI_CC_OK;
 }
 
-ipmi_ret_t UserAccess::setUserName(const uint8_t& userId,
+ipmi_ret_t UserAccess::setUserName(const uint8_t userId,
                                    const char* userNameInChar)
 {
     if (!isValidUserId(userId))
diff --git a/user_channel/user_mgmt.hpp b/user_channel/user_mgmt.hpp
index 5755fa0..a54486f 100644
--- a/user_channel/user_mgmt.hpp
+++ b/user_channel/user_mgmt.hpp
@@ -92,7 +92,7 @@
      *
      *  @return true if valid, false otherwise
      */
-    static bool isValidChannel(const uint8_t& chNum);
+    static bool isValidChannel(const uint8_t chNum);
 
     /** @brief determines valid userId
      *
@@ -100,7 +100,7 @@
      *
      *  @return true if valid, false otherwise
      */
-    static bool isValidUserId(const uint8_t& userId);
+    static bool isValidUserId(const uint8_t userId);
 
     /** @brief determines valid user privilege
      *
@@ -108,7 +108,7 @@
      *
      *  @return true if valid, false otherwise
      */
-    static bool isValidPrivilege(const uint8_t& priv);
+    static bool isValidPrivilege(const uint8_t priv);
 
     /** @brief determines sync index to be mapped with common-user-management
      *
@@ -155,7 +155,7 @@
      *
      *  @return UserInfo for the specified user id
      */
-    UserInfo* getUserInfo(const uint8_t& userId);
+    UserInfo* getUserInfo(const uint8_t userId);
 
     /** @brief sets user information
      *
@@ -163,7 +163,7 @@
      *  @param[in] userInfo - user information
      *
      */
-    void setUserInfo(const uint8_t& userId, UserInfo* userInfo);
+    void setUserInfo(const uint8_t userId, UserInfo* userInfo);
 
     /** @brief provides user name
      *
@@ -172,7 +172,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t getUserName(const uint8_t& userId, std::string& userName);
+    ipmi_ret_t getUserName(const uint8_t userId, std::string& userName);
 
     /** @brief to set user name
      *
@@ -181,7 +181,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t setUserName(const uint8_t& userId, const char* userNameInChar);
+    ipmi_ret_t setUserName(const uint8_t userId, const char* userNameInChar);
 
     /** @brief to set user enabled state
      *
@@ -190,7 +190,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t setUserEnabledState(const uint8_t& userId,
+    ipmi_ret_t setUserEnabledState(const uint8_t userId,
                                    const bool& enabledState);
 
     /** @brief to set user privilege and access details
@@ -203,8 +203,7 @@
      *
      *  @return IPMI_CC_OK for success, others for failure.
      */
-    ipmi_ret_t setUserPrivilegeAccess(const uint8_t& userId,
-                                      const uint8_t& chNum,
+    ipmi_ret_t setUserPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
                                       const UserPrivAccess& privAccess,
                                       const bool& otherPrivUpdates);
 
