diff --git a/fault-monitor/fru-fault-monitor.hpp b/fault-monitor/fru-fault-monitor.hpp
index 77d3be2..54eb655 100644
--- a/fault-monitor/fru-fault-monitor.hpp
+++ b/fault-monitor/fru-fault-monitor.hpp
@@ -1,8 +1,9 @@
 #pragma once
 
+#include "config.h"
+
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server.hpp>
-#include "config.h"
 
 namespace phosphor
 {
@@ -16,13 +17,11 @@
 {
 
 /** @brief Assert or deassert an LED based on the input FRU
-  *  @param[in] bus       -  The Dbus bus object
-  *  @param[in] path      -  Inventory path of the FRU
-  *  @param[in] assert    -  Assert if true deassert if false
-  */
-void action(sdbusplus::bus::bus& bus,
-            const std::string& path,
-            bool assert);
+ *  @param[in] bus       -  The Dbus bus object
+ *  @param[in] path      -  Inventory path of the FRU
+ *  @param[in] assert    -  Assert if true deassert if false
+ */
+void action(sdbusplus::bus::bus& bus, const std::string& path, bool assert);
 
 class Remove;
 
@@ -33,44 +32,43 @@
  */
 class Add
 {
-    public:
-        Add() = delete;
-        ~Add() = default;
-        Add(const Add&) = delete;
-        Add& operator=(const Add&) = delete;
-        Add(Add&&) = default;
-        Add& operator=(Add&&) = default;
+  public:
+    Add() = delete;
+    ~Add() = default;
+    Add(const Add&) = delete;
+    Add& operator=(const Add&) = delete;
+    Add(Add&&) = default;
+    Add& operator=(Add&&) = default;
 
-        /** @brief constructs Add a watch for FRU faults.
-         *  @param[in] bus -  The Dbus bus object
-         */
-        Add(sdbusplus::bus::bus& bus):
-            matchCreated(
-                bus,
-                sdbusplus::bus::match::rules::interfacesAdded() +
+    /** @brief constructs Add a watch for FRU faults.
+     *  @param[in] bus -  The Dbus bus object
+     */
+    Add(sdbusplus::bus::bus& bus) :
+        matchCreated(
+            bus,
+            sdbusplus::bus::match::rules::interfacesAdded() +
                 sdbusplus::bus::match::rules::path_namespace(
-                        "/xyz/openbmc_project/logging"),
-                std::bind(std::mem_fn(&Add::created),
-                          this, std::placeholders::_1))
-        {
-            processExistingCallouts(bus);
-        }
-    private:
+                    "/xyz/openbmc_project/logging"),
+            std::bind(std::mem_fn(&Add::created), this, std::placeholders::_1))
+    {
+        processExistingCallouts(bus);
+    }
 
-        /** @brief sdbusplus signal match for fault created */
-        sdbusplus::bus::match_t matchCreated;
+  private:
+    /** @brief sdbusplus signal match for fault created */
+    sdbusplus::bus::match_t matchCreated;
 
-        std::vector<std::unique_ptr<Remove>> removeWatches;
+    std::vector<std::unique_ptr<Remove>> removeWatches;
 
-        /** @brief Callback function for fru fault created
-         *  @param[in] msg       - Data associated with subscribed signal
-         */
-        void created(sdbusplus::message::message& msg);
+    /** @brief Callback function for fru fault created
+     *  @param[in] msg       - Data associated with subscribed signal
+     */
+    void created(sdbusplus::message::message& msg);
 
-        /** @brief This function process all callouts at application start
-         *  @param[in] bus - The Dbus bus object
-         */
-        void processExistingCallouts(sdbusplus::bus::bus& bus);
+    /** @brief This function process all callouts at application start
+     *  @param[in] bus - The Dbus bus object
+     */
+    void processExistingCallouts(sdbusplus::bus::bus& bus);
 };
 
 /** @class Remove
@@ -80,59 +78,55 @@
  */
 class Remove
 {
-    public:
-        Remove() = delete;
-        ~Remove() = default;
-        Remove(const Remove&) = delete;
-        Remove& operator=(const Remove&) = delete;
-        Remove(Remove&&) = default;
-        Remove& operator=(Remove&&) = default;
+  public:
+    Remove() = delete;
+    ~Remove() = default;
+    Remove(const Remove&) = delete;
+    Remove& operator=(const Remove&) = delete;
+    Remove(Remove&&) = default;
+    Remove& operator=(Remove&&) = default;
 
-        /** @brief constructs Remove
-         *  @param[in] bus  -  The Dbus bus object
-         *  @param[in] path -  Inventory path to fru
-         */
-        Remove(sdbusplus::bus::bus& bus, const std::string& path):
-            inventoryPath(path),
-            matchRemoved(
-                bus,
-                match(path),
-                std::bind(std::mem_fn(&Remove::removed),
-                          this, std::placeholders::_1))
-        {
-            //Do nothing
-        }
+    /** @brief constructs Remove
+     *  @param[in] bus  -  The Dbus bus object
+     *  @param[in] path -  Inventory path to fru
+     */
+    Remove(sdbusplus::bus::bus& bus, const std::string& path) :
+        inventoryPath(path),
+        matchRemoved(bus, match(path),
+                     std::bind(std::mem_fn(&Remove::removed), this,
+                               std::placeholders::_1))
+    {
+        // Do nothing
+    }
 
-    private:
+  private:
+    /** @brief inventory path of the FRU */
+    std::string inventoryPath;
 
-        /** @brief inventory path of the FRU */
-        std::string inventoryPath;
+    /** @brief sdbusplus signal matches for fault removed */
+    sdbusplus::bus::match_t matchRemoved;
 
-        /** @brief sdbusplus signal matches for fault removed */
-        sdbusplus::bus::match_t matchRemoved;
+    /** @brief Callback function for fru fault created
+     *  @param[in] msg       - Data associated with subscribed signal
+     */
+    void removed(sdbusplus::message::message& msg);
 
-        /** @brief Callback function for fru fault created
-         *  @param[in] msg       - Data associated with subscribed signal
-         */
-        void removed(sdbusplus::message::message& msg);
+    /** @brief function to create fault remove match for a fru
+     *  @param[in] path  - Inventory path of the faulty unit.
+     */
+    std::string match(const std::string& path)
+    {
+        namespace MatchRules = sdbusplus::bus::match::rules;
 
-        /** @brief function to create fault remove match for a fru
-         *  @param[in] path  - Inventory path of the faulty unit.
-         */
-        std::string match(const std::string& path)
-        {
-            namespace MatchRules = sdbusplus::bus::match::rules;
+        std::string matchStmt =
+            MatchRules::interfacesRemoved() +
+            MatchRules::argNpath(0, path + "/" + CALLOUT_REV_ASSOCIATION);
 
-            std::string matchStmt =
-                    MatchRules::interfacesRemoved() +
-                    MatchRules::argNpath(
-                            0, path + "/" + CALLOUT_REV_ASSOCIATION);
-
-            return matchStmt;
-        }
+        return matchStmt;
+    }
 };
-}//namespace monitor
-}//namespace fault
-}//namespace fru
-}//namespace led
-}//namespace phosphor
+} // namespace monitor
+} // namespace fault
+} // namespace fru
+} // namespace led
+} // namespace phosphor
