diff --git a/include/TachSensor.hpp b/include/TachSensor.hpp
index fa9de07..e719293 100644
--- a/include/TachSensor.hpp
+++ b/include/TachSensor.hpp
@@ -28,7 +28,6 @@
 
   private:
     bool status = true;
-    bool inverted;
     gpiod::line gpioLine;
     boost::asio::posix::stream_descriptor gpioFd;
     std::string name;
diff --git a/src/ADCSensor.cpp b/src/ADCSensor.cpp
index 5abee29..8c335e5 100644
--- a/src/ADCSensor.cpp
+++ b/src/ADCSensor.cpp
@@ -34,7 +34,6 @@
 #include <string>
 #include <vector>
 
-static constexpr size_t warnAfterErrorCount = 10;
 // scaling factor from hwmon
 static constexpr unsigned int sensorScaleFactor = 1000;
 
diff --git a/src/ADCSensorMain.cpp b/src/ADCSensorMain.cpp
index 4f35a7f..9311834 100644
--- a/src/ADCSensorMain.cpp
+++ b/src/ADCSensorMain.cpp
@@ -35,7 +35,6 @@
 #include <variant>
 #include <vector>
 
-static constexpr bool debug = false;
 static constexpr float pollRateDefault = 0.5;
 static constexpr float gpioBridgeSetupTimeDefault = 0.02;
 
@@ -75,9 +74,8 @@
 {
     auto getter = std::make_shared<GetSensorConfiguration>(
         dbusConnection,
-        std::move([&io, &objectServer, &sensors, &dbusConnection,
-                   sensorsChanged](
-                      const ManagedObjectType& sensorConfigurations) {
+        [&io, &objectServer, &sensors, &dbusConnection,
+         sensorsChanged](const ManagedObjectType& sensorConfigurations) {
             bool firstScan = sensorsChanged == nullptr;
             std::vector<fs::path> paths;
             if (!findFiles(fs::path("/sys/class/hwmon"), R"(in\d+_input)",
@@ -306,7 +304,7 @@
                     readState, *interfacePath, std::move(bridgeGpio));
                 sensor->setupRead();
             }
-        }));
+        });
 
     getter->getConfiguration(
         std::vector<std::string>{sensorTypes.begin(), sensorTypes.end()});
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
index de8607b..73f2ee1 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
@@ -181,7 +181,6 @@
 
     for (const fs::path& hwmonNamePath : hwmonNamePaths)
     {
-        const std::string& pathStr = hwmonNamePath.string();
         auto hwmonDirectory = hwmonNamePath.parent_path();
 
         auto ret = scannedDirectories.insert(hwmonDirectory.string());
diff --git a/src/ExitAirTempSensor.cpp b/src/ExitAirTempSensor.cpp
index 70b9e7a..0165ffc 100644
--- a/src/ExitAirTempSensor.cpp
+++ b/src/ExitAirTempSensor.cpp
@@ -203,27 +203,26 @@
 {
 
     std::weak_ptr<CFMSensor> weakRef = weak_from_this();
-    setupSensorMatch(matches, *dbusConnection, "fan_tach",
-                     std::move([weakRef](const double& value,
-                                         sdbusplus::message::message& message) {
-                         auto self = weakRef.lock();
-                         if (!self)
-                         {
-                             return;
-                         }
-                         self->tachReadings[message.get_path()] = value;
-                         if (self->tachRanges.find(message.get_path()) ==
-                             self->tachRanges.end())
-                         {
-                             // calls update reading after updating ranges
-                             self->addTachRanges(message.get_sender(),
-                                                 message.get_path());
-                         }
-                         else
-                         {
-                             self->updateReading();
-                         }
-                     }));
+    setupSensorMatch(
+        matches, *dbusConnection, "fan_tach",
+        [weakRef](const double& value, sdbusplus::message::message& message) {
+            auto self = weakRef.lock();
+            if (!self)
+            {
+                return;
+            }
+            self->tachReadings[message.get_path()] = value;
+            if (self->tachRanges.find(message.get_path()) ==
+                self->tachRanges.end())
+            {
+                // calls update reading after updating ranges
+                self->addTachRanges(message.get_sender(), message.get_path());
+            }
+            else
+            {
+                self->updateReading();
+            }
+        });
 
     dbusConnection->async_method_call(
         [weakRef](const boost::system::error_code ec,
@@ -883,9 +882,8 @@
         return;
     }
     auto getter = std::make_shared<GetSensorConfiguration>(
-        dbusConnection,
-        std::move([&objectServer, &dbusConnection,
-                   &exitAirSensor](const ManagedObjectType& resp) {
+        dbusConnection, [&objectServer, &dbusConnection,
+                         &exitAirSensor](const ManagedObjectType& resp) {
             cfmSensors.clear();
             for (const auto& pathPair : resp)
             {
@@ -955,7 +953,7 @@
                 exitAirSensor->setupMatches();
                 exitAirSensor->updateReading();
             }
-        }));
+        });
     getter->getConfiguration(
         std::vector<std::string>(monitorIfaces.begin(), monitorIfaces.end()));
 }
diff --git a/src/ExternalSensor.cpp b/src/ExternalSensor.cpp
index 17f5300..745c65b 100644
--- a/src/ExternalSensor.cpp
+++ b/src/ExternalSensor.cpp
@@ -95,7 +95,7 @@
 
     // Connect ExternalSensor with Sensor
     auto weakThis = weak_from_this();
-    externalSetHook = std::move([weakThis]() {
+    externalSetHook = [weakThis]() {
         auto lockThis = weakThis.lock();
         if (lockThis)
         {
@@ -106,7 +106,7 @@
         {
             std::cerr << "ExternalSensor receive ignored, sensor gone\n";
         }
-    });
+    };
 }
 
 ExternalSensor::~ExternalSensor()
diff --git a/src/ExternalSensorMain.cpp b/src/ExternalSensorMain.cpp
index 647eb5a..1ced726 100644
--- a/src/ExternalSensorMain.cpp
+++ b/src/ExternalSensorMain.cpp
@@ -148,7 +148,7 @@
 }
 
 void createSensors(
-    boost::asio::io_service& io, sdbusplus::asio::object_server& objectServer,
+    sdbusplus::asio::object_server& objectServer,
     boost::container::flat_map<std::string, std::shared_ptr<ExternalSensor>>&
         sensors,
     std::shared_ptr<sdbusplus::asio::connection>& dbusConnection,
@@ -163,7 +163,7 @@
 
     auto getter = std::make_shared<GetSensorConfiguration>(
         dbusConnection,
-        [&io, &objectServer, &sensors, &dbusConnection, sensorsChanged,
+        [&objectServer, &sensors, &dbusConnection, sensorsChanged,
          &reaperTimer](const ManagedObjectType& sensorConfigurations) {
             bool firstScan = (sensorsChanged == nullptr);
 
@@ -362,15 +362,14 @@
         std::make_shared<boost::container::flat_set<std::string>>();
     boost::asio::steady_timer reaperTimer(io);
 
-    io.post([&io, &objectServer, &sensors, &systemBus, &reaperTimer]() {
-        createSensors(io, objectServer, sensors, systemBus, nullptr,
-                      reaperTimer);
+    io.post([&objectServer, &sensors, &systemBus, &reaperTimer]() {
+        createSensors(objectServer, sensors, systemBus, nullptr, reaperTimer);
     });
 
     boost::asio::deadline_timer filterTimer(io);
     std::function<void(sdbusplus::message::message&)> eventHandler =
-        [&io, &objectServer, &sensors, &systemBus, &sensorsChanged,
-         &filterTimer, &reaperTimer](sdbusplus::message::message& message) {
+        [&objectServer, &sensors, &systemBus, &sensorsChanged, &filterTimer,
+         &reaperTimer](sdbusplus::message::message& message) mutable {
             if (message.is_method_error())
             {
                 std::cerr << "callback method error\n";
@@ -388,21 +387,22 @@
             // this implicitly cancels the timer
             filterTimer.expires_from_now(boost::posix_time::seconds(1));
 
-            filterTimer.async_wait([&io, &objectServer, &sensors, &systemBus,
-                                    &sensorsChanged, &reaperTimer](
-                                       const boost::system::error_code& ec) {
-                if (ec != boost::system::errc::success)
-                {
-                    if (ec != boost::asio::error::operation_aborted)
+            filterTimer.async_wait(
+                [&objectServer, &sensors, &systemBus, &sensorsChanged,
+                 &reaperTimer](const boost::system::error_code& ec) mutable {
+                    if (ec != boost::system::errc::success)
                     {
-                        std::cerr << "callback error: " << ec.message() << "\n";
+                        if (ec != boost::asio::error::operation_aborted)
+                        {
+                            std::cerr << "callback error: " << ec.message()
+                                      << "\n";
+                        }
+                        return;
                     }
-                    return;
-                }
 
-                createSensors(io, objectServer, sensors, systemBus,
-                              sensorsChanged, reaperTimer);
-            });
+                    createSensors(objectServer, sensors, systemBus,
+                                  sensorsChanged, reaperTimer);
+                });
         };
 
     auto match = std::make_unique<sdbusplus::bus::match::match>(
diff --git a/src/FanMain.cpp b/src/FanMain.cpp
index 465ce1b..cb0afd3 100644
--- a/src/FanMain.cpp
+++ b/src/FanMain.cpp
@@ -39,8 +39,6 @@
 #include <variant>
 #include <vector>
 
-static constexpr bool debug = false;
-
 namespace fs = std::filesystem;
 
 // The following two structures need to be consistent
@@ -163,9 +161,8 @@
 {
     auto getter = std::make_shared<GetSensorConfiguration>(
         dbusConnection,
-        std::move([&io, &objectServer, &tachSensors, &pwmSensors,
-                   &dbusConnection, sensorsChanged](
-                      const ManagedObjectType& sensorConfigurations) {
+        [&io, &objectServer, &tachSensors, &pwmSensors, &dbusConnection,
+         sensorsChanged](const ManagedObjectType& sensorConfigurations) {
             bool firstScan = sensorsChanged == nullptr;
             std::vector<fs::path> paths;
             if (!findFiles(fs::path("/sys/class/hwmon"), R"(fan\d+_input)",
@@ -448,7 +445,7 @@
             }
 
             createRedundancySensor(tachSensors, dbusConnection, objectServer);
-        }));
+        });
     getter->getConfiguration(
         std::vector<std::string>{sensorTypes.begin(), sensorTypes.end()},
         retries);
diff --git a/src/HwmonTempMain.cpp b/src/HwmonTempMain.cpp
index 4f259dc..d9fe52d 100644
--- a/src/HwmonTempMain.cpp
+++ b/src/HwmonTempMain.cpp
@@ -36,7 +36,6 @@
 #include <variant>
 #include <vector>
 
-static constexpr bool debug = false;
 static constexpr float pollRateDefault = 0.5;
 
 namespace fs = std::filesystem;
@@ -69,9 +68,8 @@
 {
     auto getter = std::make_shared<GetSensorConfiguration>(
         dbusConnection,
-        std::move([&io, &objectServer, &sensors, &dbusConnection,
-                   sensorsChanged](
-                      const ManagedObjectType& sensorConfigurations) {
+        [&io, &objectServer, &sensors, &dbusConnection,
+         sensorsChanged](const ManagedObjectType& sensorConfigurations) {
             bool firstScan = sensorsChanged == nullptr;
 
             std::vector<fs::path> paths;
@@ -89,7 +87,6 @@
             for (auto& path : paths)
             {
                 std::smatch match;
-                const std::string& pathStr = path.string();
                 auto directory = path.parent_path();
 
                 auto ret = directories.insert(directory.string());
@@ -296,7 +293,7 @@
                     }
                 }
             }
-        }));
+        });
     getter->getConfiguration(
         std::vector<std::string>(sensorTypes.begin(), sensorTypes.end()));
 }
diff --git a/src/IntrusionSensorMain.cpp b/src/IntrusionSensorMain.cpp
index 154b2b2..ad4794a 100644
--- a/src/IntrusionSensorMain.cpp
+++ b/src/IntrusionSensorMain.cpp
@@ -183,8 +183,7 @@
     const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection)
 {
     auto getter = std::make_shared<GetSensorConfiguration>(
-        dbusConnection,
-        std::move([](const ManagedObjectType& sensorConfigurations) {
+        dbusConnection, [](const ManagedObjectType& sensorConfigurations) {
             // Get NIC name and save to map
             lanInfoMap.clear();
             for (const std::pair<sdbusplus::message::object_path, SensorData>&
@@ -228,7 +227,7 @@
             {
                 std::cerr << "can't find matched NIC name. \n";
             }
-        }));
+        });
 
     getter->getConfiguration(
         std::vector<std::string>{nicTypes.begin(), nicTypes.end()});
diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
index 7242c96..d2afba7 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -38,7 +38,6 @@
 #include <vector>
 
 static constexpr unsigned int pwmPollMs = 500;
-static constexpr size_t warnAfterErrorCount = 10;
 
 TachSensor::TachSensor(const std::string& path, const std::string& objectType,
                        sdbusplus::asio::object_server& objectServer,
@@ -204,8 +203,8 @@
 PresenceSensor::PresenceSensor(const std::string& gpioName, bool inverted,
                                boost::asio::io_service& io,
                                const std::string& name) :
-    inverted(inverted),
-    gpioLine(gpiod::find_line(gpioName)), gpioFd(io), name(name)
+    gpioLine(gpiod::find_line(gpioName)),
+    gpioFd(io), name(name)
 {
     if (!gpioLine)
     {
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index bbe8e20..c52eee6 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -344,13 +344,13 @@
         }
     }
 
-    if constexpr (debug)
+    // Throttle debug output, so that it does not continuously spam
+    ++cDebugThrottle;
+    if (cDebugThrottle >= 1000)
     {
-        // Throttle debug output, so that it does not continuously spam
-        ++cDebugThrottle;
-        if (cDebugThrottle >= 1000)
+        cDebugThrottle = 0;
+        if constexpr (debug)
         {
-            cDebugThrottle = 0;
             std::cerr << "checkThresholds: High T=" << cHiTrue
                       << " F=" << cHiFalse << " M=" << cHiMidstate
                       << ", Low T=" << cLoTrue << " F=" << cLoFalse
