diff --git a/presence/tach.hpp b/presence/tach.hpp
index 4f02521..9f2654d 100644
--- a/presence/tach.hpp
+++ b/presence/tach.hpp
@@ -1,12 +1,14 @@
 #pragma once
 
-#include <sdbusplus/message.hpp>
-#include <sdbusplus/bus/match.hpp>
-#include <string>
-#include <vector>
 #include "psensor.hpp"
 #include "sdbusplus.hpp"
 
+#include <sdbusplus/bus/match.hpp>
+#include <sdbusplus/message.hpp>
+
+#include <string>
+#include <vector>
+
 namespace phosphor
 {
 namespace fan
@@ -24,85 +26,81 @@
  */
 class Tach : public PresenceSensor
 {
-    public:
-        /**
-         * @brief
-         *
-         * Cannot move or copy due to this ptr as context
-         * for sdbus callbacks.
-         */
-        Tach() = delete;
-        Tach(const Tach&) = delete;
-        Tach& operator=(const Tach&) = delete;
-        Tach(Tach&&) = delete;
-        Tach& operator=(Tach&&) = delete;
-        ~Tach() = default;
+  public:
+    /**
+     * @brief
+     *
+     * Cannot move or copy due to this ptr as context
+     * for sdbus callbacks.
+     */
+    Tach() = delete;
+    Tach(const Tach&) = delete;
+    Tach& operator=(const Tach&) = delete;
+    Tach(Tach&&) = delete;
+    Tach& operator=(Tach&&) = delete;
+    ~Tach() = default;
 
-        /**
-         * @brief ctor
-         *
-         * @param[in] sensors - Fan tach sensors for this psensor.
-         */
-        Tach(const std::vector<std::string>& sensors);
+    /**
+     * @brief ctor
+     *
+     * @param[in] sensors - Fan tach sensors for this psensor.
+     */
+    Tach(const std::vector<std::string>& sensors);
 
-        /**
-         * @brief start
-         *
-         * Register for dbus signal callbacks on fan
-         * tach sensor change.  Query initial tach speeds.
-         *
-         * @return The current sensor state.
-         */
-        bool start() override;
+    /**
+     * @brief start
+     *
+     * Register for dbus signal callbacks on fan
+     * tach sensor change.  Query initial tach speeds.
+     *
+     * @return The current sensor state.
+     */
+    bool start() override;
 
-        /**
-         * @brief stop
-         *
-         * De-register dbus signal callbacks.
-         */
-        void stop() override;
+    /**
+     * @brief stop
+     *
+     * De-register dbus signal callbacks.
+     */
+    void stop() override;
 
-        /**
-         * @brief Check the sensor.
-         *
-         * Query the tach speeds.
-         */
-        bool present() override;
+    /**
+     * @brief Check the sensor.
+     *
+     * Query the tach speeds.
+     */
+    bool present() override;
 
-    private :
-        /**
-         * @brief Get the policy associated with this sensor.
-         */
-        virtual RedundancyPolicy& getPolicy() = 0;
+  private:
+    /**
+     * @brief Get the policy associated with this sensor.
+     */
+    virtual RedundancyPolicy& getPolicy() = 0;
 
-        /**
-         * @brief Properties changed handler for tach sensor updates.
-         *
-         * @param[in] sensor - The sensor that changed.
-         * @param[in] props - The properties that changed.
-         */
-        void propertiesChanged(
-            size_t sensor,
-            const phosphor::fan::util::Properties<int64_t>& props);
+    /**
+     * @brief Properties changed handler for tach sensor updates.
+     *
+     * @param[in] sensor - The sensor that changed.
+     * @param[in] props - The properties that changed.
+     */
+    void propertiesChanged(
+        size_t sensor, const phosphor::fan::util::Properties<int64_t>& props);
 
-        /**
-         * @brief Properties changed handler for tach sensor updates.
-         *
-         * @param[in] sensor - The sensor that changed.
-         * @param[in] msg - The sdbusplus signal message.
-         */
-        void propertiesChanged(
-            size_t sensor,
-            sdbusplus::message::message& msg);
+    /**
+     * @brief Properties changed handler for tach sensor updates.
+     *
+     * @param[in] sensor - The sensor that changed.
+     * @param[in] msg - The sdbusplus signal message.
+     */
+    void propertiesChanged(size_t sensor, sdbusplus::message::message& msg);
 
-        /** @brief array of tach sensors dbus matches, and tach values. */
-        std::vector<std::tuple<
-            std::string,
-            std::unique_ptr<sdbusplus::bus::match::match>,
-            int64_t>> state;
+    /** @brief array of tach sensors dbus matches, and tach values. */
+    std::vector<std::tuple<
+        std::string, std::unique_ptr<sdbusplus::bus::match::match>, int64_t>>
+        state;
 
-        /** The current state of the sensor. */
-        bool currentState;
+    /** The current state of the sensor. */
+    bool currentState;
 };
 
 } // namespace presence
