diff --git a/control/Makefile.am b/control/Makefile.am
index 9ca1797..43f7b69 100644
--- a/control/Makefile.am
+++ b/control/Makefile.am
@@ -9,6 +9,7 @@
 	fan.cpp \
 	main.cpp \
 	manager.cpp \
+	preconditions.cpp \
 	actions.cpp \
 	triggers.cpp \
 	zone.cpp
diff --git a/control/preconditions.cpp b/control/preconditions.cpp
new file mode 100644
index 0000000..b2bd420
--- /dev/null
+++ b/control/preconditions.cpp
@@ -0,0 +1,81 @@
+#include <algorithm>
+#include <phosphor-logging/log.hpp>
+#include "preconditions.hpp"
+#include "zone.hpp"
+
+namespace phosphor
+{
+namespace fan
+{
+namespace control
+{
+namespace precondition
+{
+
+using namespace phosphor::fan;
+
+Action property_states_match(std::vector<PrecondGroup>&& pg,
+                             std::vector<SetSpeedEvent>&& sse)
+{
+    return [pg = std::move(pg),
+            sse = std::move(sse)](auto& zone, auto& group)
+    {
+        // Compare given precondition entries
+        auto precondState = std::all_of(
+            pg.begin(),
+            pg.end(),
+            [&zone](auto const& entry)
+            {
+                try
+                {
+                    return zone.getPropValueVariant(
+                        std::get<pcPathPos>(entry),
+                        std::get<pcIntfPos>(entry),
+                        std::get<pcPropPos>(entry)) ==
+                                std::get<pcValuePos>(entry);
+                }
+                catch (const std::out_of_range& oore)
+                {
+                    // Default to property variants not equal when not found
+                    return false;
+                }
+            });
+
+        if (precondState)
+        {
+            log<level::DEBUG>(
+                "Preconditions passed, init the associated events",
+                entry("EVENT_COUNT=%u", sse.size()));
+            // Init the events when all the precondition(s) are true
+            std::for_each(
+                sse.begin(),
+                sse.end(),
+                [&zone](auto const& entry)
+                {
+                    zone.initEvent(entry);
+                });
+        }
+        else
+        {
+            log<level::DEBUG>(
+                "Preconditions not met for events, events removed if present",
+                entry("EVENT_COUNT=%u", sse.size()));
+            // Unsubscribe the events' signals when any precondition is false
+            std::for_each(
+                sse.begin(),
+                sse.end(),
+                [&zone](auto const& entry)
+                {
+                    zone.removeEvent(entry);
+                });
+            zone.setFullSpeed();
+        }
+        // Update group's fan control active allowed
+        zone.setActiveAllow(&group, precondState);
+    };
+}
+
+} // namespace precondition
+} // namespace control
+} // namespace fan
+} // namespace phosphor
diff --git a/control/preconditions.hpp b/control/preconditions.hpp
index 1423ac0..1ee3cf6 100644
--- a/control/preconditions.hpp
+++ b/control/preconditions.hpp
@@ -1,7 +1,6 @@
 #pragma once
 
-#include <algorithm>
-#include <phosphor-logging/log.hpp>
+#include "types.hpp"
 
 namespace phosphor
 {
@@ -30,66 +29,8 @@
  *     A lambda function to compare precondition property value states
  *     and either subscribe or unsubscribe a set speed event group.
  */
-auto property_states_match(std::vector<PrecondGroup>&& pg,
-                           std::vector<SetSpeedEvent>&& sse)
-{
-    return [pg = std::move(pg),
-            sse = std::move(sse)](auto& zone, auto& group)
-    {
-        // Compare given precondition entries
-        auto precondState = std::all_of(
-            pg.begin(),
-            pg.end(),
-            [&zone](auto const& entry)
-            {
-                try
-                {
-                    return zone.getPropValueVariant(
-                        std::get<pcPathPos>(entry),
-                        std::get<pcIntfPos>(entry),
-                        std::get<pcPropPos>(entry)) ==
-                                std::get<pcValuePos>(entry);
-                }
-                catch (const std::out_of_range& oore)
-                {
-                    // Default to property variants not equal when not found
-                    return false;
-                }
-            });
-
-        if (precondState)
-        {
-            log<level::DEBUG>(
-                "Preconditions passed, init the associated events",
-                entry("EVENT_COUNT=%u", sse.size()));
-            // Init the events when all the precondition(s) are true
-            std::for_each(
-                sse.begin(),
-                sse.end(),
-                [&zone](auto const& entry)
-                {
-                    zone.initEvent(entry);
-                });
-        }
-        else
-        {
-            log<level::DEBUG>(
-                "Preconditions not met for events, events removed if present",
-                entry("EVENT_COUNT=%u", sse.size()));
-            // Unsubscribe the events' signals when any precondition is false
-            std::for_each(
-                sse.begin(),
-                sse.end(),
-                [&zone](auto const& entry)
-                {
-                    zone.removeEvent(entry);
-                });
-            zone.setFullSpeed();
-        }
-        // Update group's fan control active allowed
-        zone.setActiveAllow(&group, precondState);
-    };
-}
+Action property_states_match(std::vector<PrecondGroup>&& pg,
+                             std::vector<SetSpeedEvent>&& sse);
 
 } // namespace precondition
 } // namespace control
