diff --git a/control/json/triggers/init.cpp b/control/json/triggers/init.cpp
index a060853..1ce272c 100644
--- a/control/json/triggers/init.cpp
+++ b/control/json/triggers/init.cpp
@@ -132,12 +132,14 @@
         handler = methods.find(method);
     }
 
-    for (auto& action : actions)
-    {
-        // Groups are optional, so a method is only required if there are groups
-        // i.e.) An init triggered event without any groups results in just
-        // running the actions
-        if (!action->getGroups().empty() && handler == methods.end())
+    return [handler = std::move(handler)](
+               const std::string& eventName, Manager* mgr,
+               const std::vector<Group>& groups,
+               std::vector<std::unique_ptr<ActionBase>>& actions) {
+        // Event groups are optional, so a method is only required if there
+        // are event groups i.e.) An init triggered event without any event
+        // groups results in just running the actions
+        if (!groups.empty() && handler == methods.end())
         {
             // Construct list of available methods
             auto availMethods = std::accumulate(
@@ -152,20 +154,15 @@
             log<level::ERR>(msg.c_str());
             throw std::runtime_error(msg.c_str());
         }
-    }
 
-    return [handler = std::move(handler)](
-               const std::string& eventName, Manager* mgr,
-               const std::vector<Group>& groups,
-               std::vector<std::unique_ptr<ActionBase>>& actions) {
+        for (const auto& group : groups)
+        {
+            // Call method handler for each group to populate cache
+            handler->second(mgr, group);
+        }
         for (auto& action : actions)
         {
-            for (const auto& group : action->getGroups())
-            {
-                // Call method handler for each group in the actions
-                handler->second(mgr, group);
-            }
-            // Run the action
+            // Run each action after initializing all the groups
             action->run();
         }
     };
