diff --git a/src/utils/conversion.hpp b/src/utils/conversion.hpp
index f528044..e92249a 100644
--- a/src/utils/conversion.hpp
+++ b/src/utils/conversion.hpp
@@ -90,10 +90,9 @@
 inline T toEnum(const std::array<std::pair<std::string_view, T>, N>& data,
                 const std::string& value)
 {
-    auto it = std::find_if(std::begin(data), std::end(data),
-                           [&value](const auto& item) {
-        return item.first == value;
-    });
+    auto it = std::find_if(
+        std::begin(data), std::end(data),
+        [&value](const auto& item) { return item.first == value; });
     if (it == std::end(data))
     {
         throwConversionError(EnumTraits<T>::propertyName);
@@ -106,10 +105,9 @@
     enumToString(const std::array<std::pair<std::string_view, T>, N>& data,
                  T value)
 {
-    auto it = std::find_if(std::begin(data), std::end(data),
-                           [value](const auto& item) {
-        return item.second == value;
-    });
+    auto it = std::find_if(
+        std::begin(data), std::end(data),
+        [value](const auto& item) { return item.second == value; });
     if (it == std::end(data))
     {
         throwConversionError(EnumTraits<T>::propertyName);
diff --git a/src/utils/conversion_trigger.cpp b/src/utils/conversion_trigger.cpp
index 98ae2a5..d577f76 100644
--- a/src/utils/conversion_trigger.cpp
+++ b/src/utils/conversion_trigger.cpp
@@ -44,29 +44,27 @@
     const std::vector<numeric::LabeledThresholdParam>& arg) const
 {
     return utils::transform(
-        arg,
-        [](const numeric::LabeledThresholdParam& labeledThresholdParam) {
+        arg, [](const numeric::LabeledThresholdParam& labeledThresholdParam) {
         return numeric::ThresholdParam(
             numeric::typeToString(labeledThresholdParam.at_label<ts::Type>()),
             labeledThresholdParam.at_label<ts::DwellTime>(),
             numeric::directionToString(
                 labeledThresholdParam.at_label<ts::Direction>()),
             labeledThresholdParam.at_label<ts::ThresholdValue>());
-        });
+    });
 }
 
 TriggerThresholdParams FromLabeledThresholdParamConversion::operator()(
     const std::vector<discrete::LabeledThresholdParam>& arg) const
 {
     return utils::transform(
-        arg,
-        [](const discrete::LabeledThresholdParam& labeledThresholdParam) {
+        arg, [](const discrete::LabeledThresholdParam& labeledThresholdParam) {
         return discrete::ThresholdParam(
             labeledThresholdParam.at_label<ts::UserId>(),
             utils::enumToString(labeledThresholdParam.at_label<ts::Severity>()),
             labeledThresholdParam.at_label<ts::DwellTime>(),
             labeledThresholdParam.at_label<ts::ThresholdValue>());
-        });
+    });
 }
 
 SensorsInfo fromLabeledSensorsInfo(const std::vector<LabeledSensorInfo>& infos)
diff --git a/src/utils/labeled_tuple.hpp b/src/utils/labeled_tuple.hpp
index b320c3b..c519dd4 100644
--- a/src/utils/labeled_tuple.hpp
+++ b/src/utils/labeled_tuple.hpp
@@ -210,7 +210,7 @@
             return std::apply(
                 [&](auto&&... y) { return (true && ... && detail::eq(x, y)); },
                 value);
-            },
+        },
             other.value);
     }
 
diff --git a/src/utils/make_id_name.cpp b/src/utils/make_id_name.cpp
index 1148622..0f78ab6 100644
--- a/src/utils/make_id_name.cpp
+++ b/src/utils/make_id_name.cpp
@@ -49,12 +49,11 @@
     {
         strippedId = defaultName;
     }
-    strippedId.erase(std::remove_if(
-                         strippedId.begin(), strippedId.end(),
-                         [](char c) {
+    strippedId.erase(std::remove_if(strippedId.begin(), strippedId.end(),
+                                    [](char c) {
         return c == '/' || utils::constants::allowedCharactersInPath.find(c) ==
                                std::string_view::npos;
-                         }),
+    }),
                      strippedId.end());
 
     size_t idx = 0;
diff --git a/src/utils/messanger_service.cpp b/src/utils/messanger_service.cpp
index 25f154c..56c38f6 100644
--- a/src/utils/messanger_service.cpp
+++ b/src/utils/messanger_service.cpp
@@ -16,11 +16,11 @@
 
 void MessangerService::destroy(MessangerService::Context& context)
 {
-    contexts_.erase(
-        std::remove_if(
-            contexts_.begin(), contexts_.end(),
-            [&context](const auto& item) { return item.get() == &context; }),
-        contexts_.end());
+    contexts_.erase(std::remove_if(contexts_.begin(), contexts_.end(),
+                                   [&context](const auto& item) {
+        return item.get() == &context;
+    }),
+                    contexts_.end());
 }
 
 boost::asio::execution_context::id MessangerService::id = {};
diff --git a/src/utils/threshold_operations.hpp b/src/utils/threshold_operations.hpp
index 42d469e..99ae4a5 100644
--- a/src/utils/threshold_operations.hpp
+++ b/src/utils/threshold_operations.hpp
@@ -22,11 +22,10 @@
         getDetails(ThresholdType* thresholdPtr,
                    const interfaces::Sensor& sensor)
     {
-        auto it = std::find_if(thresholdPtr->sensorDetails.begin(),
-                               thresholdPtr->sensorDetails.end(),
-                               [&sensor](const auto& x) {
-            return &sensor == x.first.get();
-        });
+        auto it = std::find_if(
+            thresholdPtr->sensorDetails.begin(),
+            thresholdPtr->sensorDetails.end(),
+            [&sensor](const auto& x) { return &sensor == x.first.get(); });
         return *it->second;
     }
 
