diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
 IndentWrappedFunctionNames: true
 InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
 LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
@@ -98,13 +98,14 @@
 ObjCSpaceBeforeProtocolList: true
 PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
 PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
diff --git a/include/cryptsetupInterface.hpp b/include/cryptsetupInterface.hpp
index fb03a8b..4f824cd 100644
--- a/include/cryptsetupInterface.hpp
+++ b/include/cryptsetupInterface.hpp
@@ -63,12 +63,10 @@
      *
      *  @returns allocated key slot number or negative errno otherwise.
      */
-    virtual int cryptKeyslotChangeByPassphrase(struct crypt_device* cd,
-                                               int keyslotOld, int keyslotNew,
-                                               const char* passphrase,
-                                               size_t passphraseSize,
-                                               const char* newPassphrase,
-                                               size_t newPassphraseSize) = 0;
+    virtual int cryptKeyslotChangeByPassphrase(
+        struct crypt_device* cd, int keyslotOld, int keyslotNew,
+        const char* passphrase, size_t passphraseSize,
+        const char* newPassphrase, size_t newPassphraseSize) = 0;
 
     /** @brief Wrapper around crypt_keyslot_add_by_volume_key.
      *  @details Used for mocking purposes.
@@ -83,11 +81,10 @@
      *
      *  @returns allocated key slot number or negative errno otherwise.
      */
-    virtual int cryptKeyslotAddByVolumeKey(struct crypt_device* cd, int keyslot,
-                                           const char* volumeKey,
-                                           size_t volumeKeySize,
-                                           const char* passphrase,
-                                           size_t passphraseSize) = 0;
+    virtual int cryptKeyslotAddByVolumeKey(
+        struct crypt_device* cd, int keyslot, const char* volumeKey,
+        size_t volumeKeySize, const char* passphrase,
+        size_t passphraseSize) = 0;
 
     /** @brief Wrapper around crypt_load.
      *  @details Used for mocking purposes.
@@ -114,11 +111,9 @@
      *
      *  @returns unlocked key slot number or negative errno otherwise.
      */
-    virtual int cryptActivateByPassphrase(struct crypt_device* cd,
-                                          const char* name, int keyslot,
-                                          const char* passphrase,
-                                          size_t passphraseSize,
-                                          uint32_t flags) = 0;
+    virtual int cryptActivateByPassphrase(
+        struct crypt_device* cd, const char* name, int keyslot,
+        const char* passphrase, size_t passphraseSize, uint32_t flags) = 0;
 
     /** @brief Wrapper around crypt_deactivate.
      *  @details Used for mocking purposes.
@@ -159,8 +154,8 @@
      *
      * @return value defined by crypt_keyslot_info
      */
-    virtual crypt_keyslot_info cryptKeySlotStatus(struct crypt_device* cd,
-                                                  int keyslot) = 0;
+    virtual crypt_keyslot_info
+        cryptKeySlotStatus(struct crypt_device* cd, int keyslot) = 0;
 
     /** @brief Wrapper around crypt_get_dir.
      *  @details Used for mocking purposes.
@@ -193,11 +188,10 @@
                             volumeKeySize, params);
     }
 
-    int cryptKeyslotChangeByPassphrase(struct crypt_device* cd, int keyslotOld,
-                                       int keyslotNew, const char* passphrase,
-                                       size_t passphraseSize,
-                                       const char* newPassphrase,
-                                       size_t newPassphraseSize) override
+    int cryptKeyslotChangeByPassphrase(
+        struct crypt_device* cd, int keyslotOld, int keyslotNew,
+        const char* passphrase, size_t passphraseSize,
+        const char* newPassphrase, size_t newPassphraseSize) override
     {
         return crypt_keyslot_change_by_passphrase(
             cd, keyslotOld, keyslotNew, passphrase, passphraseSize,
@@ -219,10 +213,9 @@
         return crypt_load(cd, requestedType, params);
     }
 
-    int cryptActivateByPassphrase(struct crypt_device* cd, const char* name,
-                                  int keyslot, const char* passphrase,
-                                  size_t passphraseSize,
-                                  uint32_t flags) override
+    int cryptActivateByPassphrase(
+        struct crypt_device* cd, const char* name, int keyslot,
+        const char* passphrase, size_t passphraseSize, uint32_t flags) override
     {
         return crypt_activate_by_passphrase(cd, name, keyslot, passphrase,
                                             passphraseSize, flags);
diff --git a/include/getConfig.hpp b/include/getConfig.hpp
index 077cdb6..bcb7950 100644
--- a/include/getConfig.hpp
+++ b/include/getConfig.hpp
@@ -39,8 +39,7 @@
     GetStorageConfiguration(
         std::shared_ptr<sdbusplus::asio::connection> connection,
         std::function<void(ManagedStorageType& resp)>&& callbackFunc) :
-        dbusConnection(std::move(connection)),
-        callback(std::move(callbackFunc))
+        dbusConnection(std::move(connection)), callback(std::move(callbackFunc))
     {}
 
     GetStorageConfiguration& operator=(const GetStorageConfiguration&) = delete;
diff --git a/include/sanitize.hpp b/include/sanitize.hpp
index a9ba8e8..48b49aa 100644
--- a/include/sanitize.hpp
+++ b/include/sanitize.hpp
@@ -79,8 +79,7 @@
     Sanitize(std::string_view inDevPath,
              std::unique_ptr<IOCTLWrapperInterface> inIOCTL =
                  std::make_unique<IOCTLWrapperImpl>()) :
-        Erase(inDevPath),
-        ioctlWrapper(std::move(inIOCTL))
+        Erase(inDevPath), ioctlWrapper(std::move(inIOCTL))
     {}
 
     /** @brief sanitize the drive, using eMMC specified erase commands
diff --git a/include/util.hpp b/include/util.hpp
index 5f96c0d..a719720 100644
--- a/include/util.hpp
+++ b/include/util.hpp
@@ -26,10 +26,10 @@
                std::string& locationCode, uint64_t eraseMaxGeometry,
                uint64_t eraseMinGeometry, std::string& driveType,
                std::string& driveProtocol) :
-        deviceFile(deviceFile),
-        sysfsDir(sysfsDir), luksName(luksName), locationCode(locationCode),
-        eraseMaxGeometry(eraseMaxGeometry), eraseMinGeometry(eraseMinGeometry),
-        driveType(driveType), driveProtocol(driveProtocol)
+        deviceFile(deviceFile), sysfsDir(sysfsDir), luksName(luksName),
+        locationCode(locationCode), eraseMaxGeometry(eraseMaxGeometry),
+        eraseMinGeometry(eraseMinGeometry), driveType(driveType),
+        driveProtocol(driveProtocol)
     {}
 };
 
diff --git a/src/erase/cryptoErase.cpp b/src/erase/cryptoErase.cpp
index 08553f7..579370e 100644
--- a/src/erase/cryptoErase.cpp
+++ b/src/erase/cryptoErase.cpp
@@ -19,8 +19,7 @@
 CryptErase::CryptErase(
     std::string_view devPathIn,
     std::unique_ptr<estoraged::CryptsetupInterface> inCryptIface) :
-    Erase(devPathIn),
-    cryptIface(std::move(inCryptIface))
+    Erase(devPathIn), cryptIface(std::move(inCryptIface))
 {}
 
 void CryptErase::doErase()
diff --git a/src/erase/verifyDriveGeometry.cpp b/src/erase/verifyDriveGeometry.cpp
index 359135e..6706a36 100644
--- a/src/erase/verifyDriveGeometry.cpp
+++ b/src/erase/verifyDriveGeometry.cpp
@@ -9,9 +9,8 @@
 {
 using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 
-void VerifyDriveGeometry::geometryOkay(uint64_t eraseMaxGeometry,
-                                       uint64_t eraseMinGeometry,
-                                       uint64_t bytes)
+void VerifyDriveGeometry::geometryOkay(
+    uint64_t eraseMaxGeometry, uint64_t eraseMinGeometry, uint64_t bytes)
 {
     if (bytes > eraseMaxGeometry)
     {
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index 6c26e5a..e03fc4d 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -32,28 +32,27 @@
 using sdbusplus::xyz::openbmc_project::Inventory::Item::server::Drive;
 using sdbusplus::xyz::openbmc_project::Inventory::Item::server::Volume;
 
-EStoraged::EStoraged(sdbusplus::asio::object_server& server,
-                     const std::string& configPath, const std::string& devPath,
-                     const std::string& luksName, uint64_t size,
-                     uint8_t lifeTime, const std::string& partNumber,
-                     const std::string& serialNumber,
-                     const std::string& locationCode, uint64_t eraseMaxGeometry,
-                     uint64_t eraseMinGeometry, const std::string& driveType,
-                     const std::string& driveProtocol,
-                     std::unique_ptr<CryptsetupInterface> cryptInterface,
-                     std::unique_ptr<FilesystemInterface> fsInterface) :
-    devPath(devPath),
-    containerName(luksName), mountPoint("/mnt/" + luksName + "_fs"),
-    eraseMaxGeometry(eraseMaxGeometry), eraseMinGeometry(eraseMinGeometry),
-    cryptIface(std::move(cryptInterface)), fsIface(std::move(fsInterface)),
+EStoraged::EStoraged(
+    sdbusplus::asio::object_server& server, const std::string& configPath,
+    const std::string& devPath, const std::string& luksName, uint64_t size,
+    uint8_t lifeTime, const std::string& partNumber,
+    const std::string& serialNumber, const std::string& locationCode,
+    uint64_t eraseMaxGeometry, uint64_t eraseMinGeometry,
+    const std::string& driveType, const std::string& driveProtocol,
+    std::unique_ptr<CryptsetupInterface> cryptInterface,
+    std::unique_ptr<FilesystemInterface> fsInterface) :
+    devPath(devPath), containerName(luksName),
+    mountPoint("/mnt/" + luksName + "_fs"), eraseMaxGeometry(eraseMaxGeometry),
+    eraseMinGeometry(eraseMinGeometry), cryptIface(std::move(cryptInterface)),
+    fsIface(std::move(fsInterface)),
     cryptDevicePath(cryptIface->cryptGetDir() + "/" + luksName),
     objectServer(server)
 {
     /* Get the filename of the device (without "/dev/"). */
     std::string deviceName = std::filesystem::path(devPath).filename().string();
     /* DBus object path */
-    std::string objectPath = "/xyz/openbmc_project/inventory/storage/" +
-                             deviceName;
+    std::string objectPath =
+        "/xyz/openbmc_project/inventory/storage/" + deviceName;
 
     /* Add Volume interface. */
     volumeInterface = objectServer.add_interface(
@@ -61,8 +60,8 @@
     volumeInterface->register_method(
         "FormatLuks", [this](const std::vector<uint8_t>& password,
                              Volume::FilesystemType type) {
-        this->formatLuks(password, type);
-    });
+            this->formatLuks(password, type);
+        });
     volumeInterface->register_method(
         "Erase",
         [this](Volume::EraseMethod eraseType) { this->erase(eraseType); });
@@ -73,14 +72,14 @@
     volumeInterface->register_method(
         "ChangePassword", [this](const std::vector<uint8_t>& oldPassword,
                                  const std::vector<uint8_t>& newPassword) {
-        this->changePassword(oldPassword, newPassword);
-    });
+            this->changePassword(oldPassword, newPassword);
+        });
     volumeInterface->register_property_r(
         "Locked", lockedProperty, sdbusplus::vtable::property_::emits_change,
         [this](bool& value) {
-        value = this->isLocked();
-        return value;
-    });
+            value = this->isLocked();
+            return value;
+        });
 
     /* Add Drive interface. */
     driveInterface = objectServer.add_interface(
@@ -99,17 +98,17 @@
     driveInterface->register_property_r(
         "Locked", lockedProperty, sdbusplus::vtable::property_::emits_change,
         [this](bool& value) {
-        value = this->isLocked();
-        return value;
-    });
+            value = this->isLocked();
+            return value;
+        });
 
     driveInterface->register_property_r(
         "EncryptionStatus", encryptionStatus,
         sdbusplus::vtable::property_::emits_change,
         [this](Drive::DriveEncryptionState& value) {
-        value = this->findEncryptionStatus();
-        return value;
-    });
+            value = this->findEncryptionStatus();
+            return value;
+        });
 
     embeddedLocationInterface = objectServer.add_interface(
         objectPath, "xyz.openbmc_project.Inventory.Connector.Embedded");
diff --git a/src/getConfig.cpp b/src/getConfig.cpp
index 563a057..3d2cc5a 100644
--- a/src/getConfig.cpp
+++ b/src/getConfig.cpp
@@ -28,44 +28,43 @@
     std::pair<std::string,
               std::vector<std::pair<std::string, std::vector<std::string>>>>>;
 
-void GetStorageConfiguration::getStorageInfo(const std::string& path,
-                                             const std::string& owner,
-                                             size_t retries)
+void GetStorageConfiguration::getStorageInfo(
+    const std::string& path, const std::string& owner, size_t retries)
 {
     std::shared_ptr<GetStorageConfiguration> self = shared_from_this();
     self->dbusConnection->async_method_call(
         [self, path, owner, retries](
             const boost::system::error_code ec,
             boost::container::flat_map<std::string, BasicVariantType>& data) {
-        if (ec)
-        {
-            lg2::error(
-                "Error getting properties for {PATH}: {RETRIES} retries left",
-                "PATH", path, "RETRIES", retries - 1, "REDFISH_MESSAGE_ID",
-                std::string("OpenBMC.0.1.GetStorageInfoFail"));
-            if (retries == 0U)
+            if (ec)
             {
+                lg2::error(
+                    "Error getting properties for {PATH}: {RETRIES} retries left",
+                    "PATH", path, "RETRIES", retries - 1, "REDFISH_MESSAGE_ID",
+                    std::string("OpenBMC.0.1.GetStorageInfoFail"));
+                if (retries == 0U)
+                {
+                    return;
+                }
+
+                auto timer = std::make_shared<boost::asio::steady_timer>(
+                    self->dbusConnection->get_io_context());
+                timer->expires_after(std::chrono::seconds(10));
+                timer->async_wait([self, timer, path, owner,
+                                   retries](boost::system::error_code ec) {
+                    if (ec)
+                    {
+                        lg2::error("Timer error!");
+                        return;
+                    }
+                    self->getStorageInfo(path, owner, retries - 1);
+                });
+
                 return;
             }
 
-            auto timer = std::make_shared<boost::asio::steady_timer>(
-                self->dbusConnection->get_io_context());
-            timer->expires_after(std::chrono::seconds(10));
-            timer->async_wait([self, timer, path, owner,
-                               retries](boost::system::error_code ec) {
-                if (ec)
-                {
-                    lg2::error("Timer error!");
-                    return;
-                }
-                self->getStorageInfo(path, owner, retries - 1);
-            });
-
-            return;
-        }
-
-        self->respData[path] = std::move(data);
-    },
+            self->respData[path] = std::move(data);
+        },
         owner, path, "org.freedesktop.DBus.Properties", "GetAll",
         emmcConfigInterface);
 }
@@ -75,29 +74,29 @@
     std::shared_ptr<GetStorageConfiguration> self = shared_from_this();
     dbusConnection->async_method_call(
         [self](const boost::system::error_code ec, const GetSubTreeType& ret) {
-        if (ec)
-        {
-            lg2::error("Error calling mapper");
-            return;
-        }
-        for (const auto& [objPath, objDict] : ret)
-        {
-            if (objDict.empty())
+            if (ec)
             {
+                lg2::error("Error calling mapper");
                 return;
             }
-            const std::string& objOwner = objDict.begin()->first;
-            /* Look for the config interface exposed by this object. */
-            for (const std::string& interface : objDict.begin()->second)
+            for (const auto& [objPath, objDict] : ret)
             {
-                if (interface.compare(emmcConfigInterface) == 0)
+                if (objDict.empty())
                 {
-                    /* Get the properties exposed by this interface. */
-                    self->getStorageInfo(objPath, objOwner);
+                    return;
+                }
+                const std::string& objOwner = objDict.begin()->first;
+                /* Look for the config interface exposed by this object. */
+                for (const std::string& interface : objDict.begin()->second)
+                {
+                    if (interface.compare(emmcConfigInterface) == 0)
+                    {
+                        /* Get the properties exposed by this interface. */
+                        self->getStorageInfo(objPath, objOwner);
+                    }
                 }
             }
-        }
-    },
+        },
         mapper::busName, mapper::path, mapper::interface, mapper::subtree, "/",
         0, std::vector<const char*>(1, emmcConfigInterface));
 }
diff --git a/src/main.cpp b/src/main.cpp
index 6d92ecf..5f4be19 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -41,76 +41,83 @@
         dbusConnection,
         [&objectServer, &storageObjects](
             const estoraged::ManagedStorageType& storageConfigurations) {
-        size_t numConfigObj = storageConfigurations.size();
-        if (numConfigObj > 1)
-        {
-            lg2::error("eStoraged can only manage 1 eMMC device; found {NUM}",
-                       "NUM", numConfigObj, "REDFISH_MESSAGE_ID",
-                       std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
-            return;
-        }
-
-        for (const std::pair<sdbusplus::message::object_path,
-                             estoraged::StorageData>& storage :
-             storageConfigurations)
-        {
-            const std::string& path = storage.first.str;
-
-            if (storageObjects.find(path) != storageObjects.end())
+            size_t numConfigObj = storageConfigurations.size();
+            if (numConfigObj > 1)
             {
-                /*
-                 * We've already created this object, or at least
-                 * attempted to.
-                 */
-                continue;
+                lg2::error(
+                    "eStoraged can only manage 1 eMMC device; found {NUM}",
+                    "NUM", numConfigObj, "REDFISH_MESSAGE_ID",
+                    std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
+                return;
             }
 
-            /* Get the properties from the config object. */
-            const estoraged::StorageData& data = storage.second;
-
-            /* Look for the device file. */
-            const std::filesystem::path blockDevDir{"/sys/block"};
-            auto deviceInfo = estoraged::util::findDevice(data, blockDevDir);
-            if (!deviceInfo)
+            for (const std::pair<sdbusplus::message::object_path,
+                                 estoraged::StorageData>& storage :
+                 storageConfigurations)
             {
-                lg2::error("Device not found for path {PATH}", "PATH", path,
-                           "REDFISH_MESSAGE_ID",
-                           std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
-                /*
-                 * Set a NULL pointer as a placeholder, so that we don't
-                 * try and fail again later.
-                 */
-                storageObjects[path] = nullptr;
-                continue;
+                const std::string& path = storage.first.str;
+
+                if (storageObjects.find(path) != storageObjects.end())
+                {
+                    /*
+                     * We've already created this object, or at least
+                     * attempted to.
+                     */
+                    continue;
+                }
+
+                /* Get the properties from the config object. */
+                const estoraged::StorageData& data = storage.second;
+
+                /* Look for the device file. */
+                const std::filesystem::path blockDevDir{"/sys/block"};
+                auto deviceInfo =
+                    estoraged::util::findDevice(data, blockDevDir);
+                if (!deviceInfo)
+                {
+                    lg2::error(
+                        "Device not found for path {PATH}", "PATH", path,
+                        "REDFISH_MESSAGE_ID",
+                        std::string("OpenBMC.0.1.CreateStorageObjectsFail"));
+                    /*
+                     * Set a NULL pointer as a placeholder, so that we don't
+                     * try and fail again later.
+                     */
+                    storageObjects[path] = nullptr;
+                    continue;
+                }
+
+                std::filesystem::path deviceFile =
+                    std::move(deviceInfo->deviceFile);
+                std::filesystem::path sysfsDir =
+                    std::move(deviceInfo->sysfsDir);
+                std::string luksName = std::move(deviceInfo->luksName);
+                std::string locationCode = std::move(deviceInfo->locationCode);
+                uint64_t eraseMaxGeometry = deviceInfo->eraseMaxGeometry;
+                uint64_t eraseMinGeometry = deviceInfo->eraseMinGeometry;
+
+                uint64_t size =
+                    estoraged::util::findSizeOfBlockDevice(deviceFile);
+
+                uint8_t lifeleft =
+                    estoraged::util::findPredictedMediaLifeLeftPercent(
+                        sysfsDir);
+                std::string partNumber =
+                    estoraged::util::getPartNumber(sysfsDir);
+                std::string serialNumber =
+                    estoraged::util::getSerialNumber(sysfsDir);
+                const std::string& driveType = deviceInfo->driveType;
+                const std::string& driveProtocol = deviceInfo->driveProtocol;
+                /* Create the storage object. */
+                storageObjects[path] = std::make_unique<estoraged::EStoraged>(
+                    objectServer, path, deviceFile, luksName, size, lifeleft,
+                    partNumber, serialNumber, locationCode, eraseMaxGeometry,
+                    eraseMinGeometry, driveType, driveProtocol);
+                lg2::info("Created eStoraged object for path {PATH}", "PATH",
+                          path, "REDFISH_MESSAGE_ID",
+                          std::string("OpenBMC.0.1.CreateStorageObjects"));
             }
-
-            std::filesystem::path deviceFile =
-                std::move(deviceInfo->deviceFile);
-            std::filesystem::path sysfsDir = std::move(deviceInfo->sysfsDir);
-            std::string luksName = std::move(deviceInfo->luksName);
-            std::string locationCode = std::move(deviceInfo->locationCode);
-            uint64_t eraseMaxGeometry = deviceInfo->eraseMaxGeometry;
-            uint64_t eraseMinGeometry = deviceInfo->eraseMinGeometry;
-
-            uint64_t size = estoraged::util::findSizeOfBlockDevice(deviceFile);
-
-            uint8_t lifeleft =
-                estoraged::util::findPredictedMediaLifeLeftPercent(sysfsDir);
-            std::string partNumber = estoraged::util::getPartNumber(sysfsDir);
-            std::string serialNumber =
-                estoraged::util::getSerialNumber(sysfsDir);
-            const std::string& driveType = deviceInfo->driveType;
-            const std::string& driveProtocol = deviceInfo->driveProtocol;
-            /* Create the storage object. */
-            storageObjects[path] = std::make_unique<estoraged::EStoraged>(
-                objectServer, path, deviceFile, luksName, size, lifeleft,
-                partNumber, serialNumber, locationCode, eraseMaxGeometry,
-                eraseMinGeometry, driveType, driveProtocol);
-            lg2::info("Created eStoraged object for path {PATH}", "PATH", path,
-                      "REDFISH_MESSAGE_ID",
-                      std::string("OpenBMC.0.1.CreateStorageObjects"));
-        }
-    });
+        });
     getter->getConfiguration();
 }
 
@@ -128,8 +135,9 @@
                                    std::unique_ptr<estoraged::EStoraged>>
             storageObjects;
 
-        boost::asio::post(
-            io, [&]() { createStorageObjects(server, storageObjects, conn); });
+        boost::asio::post(io, [&]() {
+            createStorageObjects(server, storageObjects, conn);
+        });
 
         /*
          * Set up an event handler to process any new configuration objects
@@ -138,33 +146,34 @@
         boost::asio::deadline_timer filterTimer(io);
         std::function<void(sdbusplus::message_t&)> eventHandler =
             [&](sdbusplus::message_t& message) {
-            if (message.is_method_error())
-            {
-                lg2::error("eventHandler callback method error");
-                return;
-            }
-            /*
-             * This implicitly cancels the timer, if it's already pending.
-             * If there's a burst of events within a short period, we want
-             * to handle them all at once. So, we will wait this long for no
-             * more events to occur, before processing them.
-             */
-            filterTimer.expires_from_now(boost::posix_time::seconds(1));
+                if (message.is_method_error())
+                {
+                    lg2::error("eventHandler callback method error");
+                    return;
+                }
+                /*
+                 * This implicitly cancels the timer, if it's already pending.
+                 * If there's a burst of events within a short period, we want
+                 * to handle them all at once. So, we will wait this long for no
+                 * more events to occur, before processing them.
+                 */
+                filterTimer.expires_from_now(boost::posix_time::seconds(1));
 
-            filterTimer.async_wait([&](const boost::system::error_code& ec) {
-                if (ec == boost::asio::error::operation_aborted)
-                {
-                    /* we were canceled */
-                    return;
-                }
-                if (ec)
-                {
-                    lg2::error("timer error");
-                    return;
-                }
-                createStorageObjects(server, storageObjects, conn);
-            });
-        };
+                filterTimer.async_wait(
+                    [&](const boost::system::error_code& ec) {
+                        if (ec == boost::asio::error::operation_aborted)
+                        {
+                            /* we were canceled */
+                            return;
+                        }
+                        if (ec)
+                        {
+                            lg2::error("timer error");
+                            return;
+                        }
+                        createStorageObjects(server, storageObjects, conn);
+                    });
+            };
 
         auto match = std::make_unique<sdbusplus::bus::match_t>(
             static_cast<sdbusplus::bus_t&>(*conn),
diff --git a/src/test/erase/crypto_test.cpp b/src/test/erase/crypto_test.cpp
index 030f6bb..909e54d 100644
--- a/src/test/erase/crypto_test.cpp
+++ b/src/test/erase/crypto_test.cpp
@@ -63,8 +63,8 @@
 
     EXPECT_CALL(*mockCryptIface, cryptKeyslotDestroy(_, 0)).Times(1);
 
-    CryptErase myCryptErase = CryptErase(testFileName,
-                                         std::move(mockCryptIface));
+    CryptErase myCryptErase =
+        CryptErase(testFileName, std::move(mockCryptIface));
     EXPECT_NO_THROW(myCryptErase.doErase());
 }
 
@@ -79,8 +79,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeySlotMax(StrEq(CRYPT_LUKS2)))
         .WillOnce(Return(-1));
 
-    CryptErase myCryptErase = CryptErase(testFileName,
-                                         std::move(mockCryptIface));
+    CryptErase myCryptErase =
+        CryptErase(testFileName, std::move(mockCryptIface));
     EXPECT_THROW(myCryptErase.doErase(), ResourceNotFound);
 }
 
@@ -95,8 +95,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeySlotMax(StrEq(CRYPT_LUKS2)))
         .WillOnce(Return(0));
 
-    CryptErase myCryptErase = CryptErase(testFileName,
-                                         std::move(mockCryptIface));
+    CryptErase myCryptErase =
+        CryptErase(testFileName, std::move(mockCryptIface));
     EXPECT_THROW(myCryptErase.doErase(), ResourceNotFound);
 }
 
@@ -114,8 +114,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeySlotStatus(_, _))
         .WillRepeatedly(Return(CRYPT_SLOT_INVALID));
 
-    CryptErase myCryptErase = CryptErase(testFileName,
-                                         std::move(mockCryptIface));
+    CryptErase myCryptErase =
+        CryptErase(testFileName, std::move(mockCryptIface));
     EXPECT_NO_THROW(myCryptErase.doErase());
 }
 
@@ -136,8 +136,8 @@
     EXPECT_CALL(*mockCryptIface, cryptKeyslotDestroy(_, 0))
         .WillOnce(Return(-1));
 
-    CryptErase myCryptErase = CryptErase(testFileName,
-                                         std::move(mockCryptIface));
+    CryptErase myCryptErase =
+        CryptErase(testFileName, std::move(mockCryptIface));
     EXPECT_THROW(myCryptErase.doErase(), InternalFailure);
 }
 
diff --git a/src/test/erase/pattern_test.cpp b/src/test/erase/pattern_test.cpp
index bccbd37..6a475d5 100644
--- a/src/test/erase/pattern_test.cpp
+++ b/src/test/erase/pattern_test.cpp
@@ -112,41 +112,47 @@
     // test write pattern with short blocks
     EXPECT_CALL(mock, write(_))
         .WillOnce(Invoke([](std::span<const std::byte> x) {
-        std::copy_n(x.begin(), shortData1.size(), shortData1.begin());
-        return shortData1;
-    })).RetiresOnSaturation();
+            std::copy_n(x.begin(), shortData1.size(), shortData1.begin());
+            return shortData1;
+        }))
+        .RetiresOnSaturation();
     EXPECT_CALL(mock, write(_))
         .WillOnce(Invoke([](std::span<const std::byte> x) {
-        std::copy_n(x.begin(), restOfData.size(), restOfData.begin());
-        return restOfData;
-    })).RetiresOnSaturation();
+            std::copy_n(x.begin(), restOfData.size(), restOfData.begin());
+            return restOfData;
+        }))
+        .RetiresOnSaturation();
     EXPECT_CALL(mock, write(_))
         .WillOnce(Invoke([](std::span<const std::byte> x) {
-        std::copy_n(x.begin(), shortData2.size(), shortData2.begin());
-        return shortData2;
-    })).RetiresOnSaturation();
+            std::copy_n(x.begin(), shortData2.size(), shortData2.begin());
+            return shortData2;
+        }))
+        .RetiresOnSaturation();
 
     // test read pattern
     EXPECT_CALL(mock, read(_))
         .WillOnce(Invoke([](std::span<std::byte> x) {
-        std::copy_n(shortData1.begin(), shortData1.size(), x.data());
-        std::span ret(shortData1);
-        return ret;
-    })).RetiresOnSaturation();
+            std::copy_n(shortData1.begin(), shortData1.size(), x.data());
+            std::span ret(shortData1);
+            return ret;
+        }))
+        .RetiresOnSaturation();
 
     EXPECT_CALL(mock, read(_))
         .WillOnce(Invoke([](std::span<std::byte> x) {
-        std::copy_n(restOfData.begin(), restOfData.size(), x.data());
-        std::span ret(restOfData);
-        return ret;
-    })).RetiresOnSaturation();
+            std::copy_n(restOfData.begin(), restOfData.size(), x.data());
+            std::span ret(restOfData);
+            return ret;
+        }))
+        .RetiresOnSaturation();
 
     EXPECT_CALL(mock, read(_))
         .WillOnce(Invoke([](std::span<std::byte> x) {
-        std::copy_n(shortData2.begin(), shortData2.size(), x.data());
-        std::span ret(shortData2);
-        return ret;
-    })).RetiresOnSaturation();
+            std::copy_n(shortData2.begin(), shortData2.size(), x.data());
+            std::span ret(shortData2);
+            return ret;
+        }))
+        .RetiresOnSaturation();
 
     EXPECT_NO_THROW(pass.writePattern(size, mock));
     EXPECT_NO_THROW(pass.verifyPattern(size, mock));
@@ -160,8 +166,8 @@
     size_t shortSize = 128;
     Pattern tryPattern(testFileName);
     auto shortData = std::vector<std::byte>(shortSize, std::byte{0});
-    auto restOfData = std::vector<std::byte>(size - shortSize * 3,
-                                             std::byte{0});
+    auto restOfData =
+        std::vector<std::byte>(size - shortSize * 3, std::byte{0});
     std::span shortDataSpan{shortData};
     std::span restOfDataSpan{restOfData};
     // open the file and write none to it
diff --git a/src/test/erase/zero_test.cpp b/src/test/erase/zero_test.cpp
index ee9dd50..a681d6d 100644
--- a/src/test/erase/zero_test.cpp
+++ b/src/test/erase/zero_test.cpp
@@ -126,8 +126,8 @@
     size_t shortSize = 128;
     Zero pass(testFileName);
     auto shortData = std::vector<std::byte>(shortSize, std::byte{0});
-    auto restOfData = std::vector<std::byte>(size - shortSize * 3,
-                                             std::byte{0});
+    auto restOfData =
+        std::vector<std::byte>(size - shortSize * 3, std::byte{0});
     std::span shortDataSpan{shortData};
     std::span restOfDataSpan{restOfData};
     stdplus::fd::FdMock mock;
@@ -159,8 +159,8 @@
     size_t shortSize = 128;
     Zero tryZero(testFileName);
     auto shortData = std::vector<std::byte>(shortSize, std::byte{0});
-    auto restOfData = std::vector<std::byte>(size - shortSize * 3,
-                                             std::byte{0});
+    auto restOfData =
+        std::vector<std::byte>(size - shortSize * 3, std::byte{0});
     std::span shortDataSpan{shortData};
     std::span restOfDataSpan{restOfData};
     // open the file and write none zero to it
diff --git a/src/test/util_test.cpp b/src/test/util_test.cpp
index e2fdcc3..2736777 100644
--- a/src/test/util_test.cpp
+++ b/src/test/util_test.cpp
@@ -132,8 +132,8 @@
     /* Look for the device file. */
     std::filesystem::path deviceFile, sysfsDir;
     std::string luksName, locationCode;
-    auto result = estoraged::util::findDevice(data,
-                                              std::filesystem::path("./"));
+    auto result =
+        estoraged::util::findDevice(data, std::filesystem::path("./"));
     EXPECT_TRUE(result.has_value());
 
     /* Validate the results. */
@@ -190,8 +190,8 @@
     /* Look for the device file. */
     std::filesystem::path deviceFile, sysfsDir;
     std::string luksName, locationCode;
-    auto result = estoraged::util::findDevice(data,
-                                              std::filesystem::path("./"));
+    auto result =
+        estoraged::util::findDevice(data, std::filesystem::path("./"));
     EXPECT_TRUE(result.has_value());
 
     /* Validate the results. */
@@ -237,8 +237,8 @@
     typeFile.close();
 
     /* Look for the device file. */
-    auto result = estoraged::util::findDevice(data,
-                                              std::filesystem::path("./"));
+    auto result =
+        estoraged::util::findDevice(data, std::filesystem::path("./"));
     EXPECT_FALSE(result.has_value());
 
     /* Delete the dummy files. */
@@ -276,8 +276,8 @@
     typeFile.close();
 
     /* Look for the device file. */
-    auto result = estoraged::util::findDevice(data,
-                                              std::filesystem::path("./"));
+    auto result =
+        estoraged::util::findDevice(data, std::filesystem::path("./"));
     EXPECT_FALSE(result.has_value());
 
     /* Delete the dummy files. */
@@ -308,8 +308,8 @@
     std::filesystem::create_directories("def/device");
 
     /* Look for the device file. */
-    auto result = estoraged::util::findDevice(data,
-                                              std::filesystem::path("./"));
+    auto result =
+        estoraged::util::findDevice(data, std::filesystem::path("./"));
     EXPECT_FALSE(result.has_value());
 
     /* Delete the dummy files. */
