diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index 3cc0224..349c1f5 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -349,7 +349,7 @@
                         allCollections;
                     allCollections.emplace("Voltages",
                                            *std::move(voltageCollections));
-                    checkAndDoSensorsOverride(sensorAsyncResp, allCollections);
+                    setSensorsOverride(sensorAsyncResp, allCollections);
                 }
             });
 }
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 0fc7e70..b476d32 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -2938,136 +2938,6 @@
     getChassis(sensorAsyncResp, std::move(getChassisSensorListCb));
 }
 
-inline bool isOverridingAllowed(const std::string& manufacturingModeStatus)
-{
-    if (manufacturingModeStatus ==
-        "xyz.openbmc_project.Control.Security.SpecialMode.Modes.Manufacturing")
-    {
-        return true;
-    }
-
-#ifdef BMCWEB_ENABLE_VALIDATION_UNSECURE_FEATURE
-    if (manufacturingModeStatus == "xyz.openbmc_project.Control.Security."
-                                   "SpecialMode.Modes.ValidationUnsecure")
-    {
-        return true;
-    }
-
-#endif
-
-    return false;
-}
-
-/**
- * @brief Entry point for Checking the manufacturing mode before doing sensor
- * override values of given sensor
- *
- * @param sensorAsyncResp   response object
- * @param allCollections   Collections extract from sensors' request patch info
- * @param chassisSubNode   Chassis Node for which the query has to happen
- */
-inline void checkAndDoSensorsOverride(
-    const std::shared_ptr<SensorsAsyncResp>& sensorAsyncResp,
-    std::unordered_map<std::string, std::vector<nlohmann::json>>&
-        allCollections)
-{
-    BMCWEB_LOG_INFO << "checkAndDoSensorsOverride for subnode"
-                    << sensorAsyncResp->chassisSubNode << "\n";
-
-    const std::array<std::string, 1> interfaces = {
-        "xyz.openbmc_project.Security.SpecialMode"};
-
-    crow::connections::systemBus->async_method_call(
-        [sensorAsyncResp, allCollections](const boost::system::error_code ec2,
-                                          const GetSubTreeType& resp) mutable {
-            if (ec2)
-            {
-                BMCWEB_LOG_DEBUG
-                    << "Error in querying GetSubTree with Object Mapper. "
-                    << ec2;
-                messages::internalError(sensorAsyncResp->asyncResp->res);
-                return;
-            }
-#ifdef BMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE
-            // Proceed with sensor override
-            setSensorsOverride(sensorAsyncResp, allCollections);
-            return;
-#endif
-
-            if (resp.size() != 1)
-            {
-                BMCWEB_LOG_WARNING
-                    << "Overriding sensor value is not allowed - Internal "
-                       "error in querying SpecialMode property.";
-                messages::internalError(sensorAsyncResp->asyncResp->res);
-                return;
-            }
-            const std::string& path = resp[0].first;
-            const std::string& serviceName = resp[0].second.begin()->first;
-
-            if (path.empty() || serviceName.empty())
-            {
-                BMCWEB_LOG_DEBUG
-                    << "Path or service name is returned as empty. ";
-                messages::internalError(sensorAsyncResp->asyncResp->res);
-                return;
-            }
-
-            // Sensor override is allowed only in manufacturing mode or
-            // validation unsecure mode .
-            crow::connections::systemBus->async_method_call(
-                [sensorAsyncResp, allCollections,
-                 path](const boost::system::error_code ec,
-                       std::variant<std::string>& getManufactMode) mutable {
-                    if (ec)
-                    {
-                        BMCWEB_LOG_DEBUG
-                            << "Error in querying Special mode property " << ec;
-                        messages::internalError(
-                            sensorAsyncResp->asyncResp->res);
-                        return;
-                    }
-
-                    const std::string* manufacturingModeStatus =
-                        std::get_if<std::string>(&getManufactMode);
-
-                    if (nullptr == manufacturingModeStatus)
-                    {
-                        BMCWEB_LOG_DEBUG << "Sensor override mode is not "
-                                            "Enabled. Returning ... ";
-                        messages::internalError(
-                            sensorAsyncResp->asyncResp->res);
-                        return;
-                    }
-
-                    if (isOverridingAllowed(*manufacturingModeStatus))
-                    {
-                        BMCWEB_LOG_INFO << "Manufacturing mode is Enabled. "
-                                           "Proceeding further... ";
-                        setSensorsOverride(sensorAsyncResp, allCollections);
-                    }
-                    else
-                    {
-                        BMCWEB_LOG_WARNING
-                            << "Manufacturing mode is not Enabled...can't "
-                               "Override the sensor value. ";
-
-                        messages::actionNotSupported(
-                            sensorAsyncResp->asyncResp->res,
-                            "Overriding of Sensor Value for non "
-                            "manufacturing mode");
-                        return;
-                    }
-                },
-                serviceName, path, "org.freedesktop.DBus.Properties", "Get",
-                "xyz.openbmc_project.Security.SpecialMode", "SpecialMode");
-        },
-
-        "xyz.openbmc_project.ObjectMapper",
-        "/xyz/openbmc_project/object_mapper",
-        "xyz.openbmc_project.ObjectMapper", "GetSubTree", "/", 5, interfaces);
-}
-
 /**
  * @brief Retrieves mapping of Redfish URIs to sensor value property to D-Bus
  * path of the sensor.
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 078da9c..ff1bc95 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -92,7 +92,7 @@
                 {
                     allCollections.emplace("Fans", *std::move(fanCollections));
                 }
-                checkAndDoSensorsOverride(sensorsAsyncResp, allCollections);
+                setSensorsOverride(sensorsAsyncResp, allCollections);
             });
 }
 
