         true))))
 
 (defn compile-lifecycle-functions [lifecycles task-name kw]
-  (let [matched (filter #(or (= (:lifecycle/task %) :all)
-                          (= (:lifecycle/task %) task-name)) lifecycles)]
+  (let [matched (select-applicable-lifecycles lifecycles task-name)]
     (reduce
      (fn [f lifecycle]
        (let [calls-map (resolve-lifecycle-calls (:lifecycle/calls lifecycle))]

          (throw e))))
    calls-map))

(defn compile-start-task-functions [lifecycles task-name]
  (let [matched (filter #(or (= (:lifecycle/task %) :all)
                          (= (:lifecycle/task %) task-name)) lifecycles)
        fs
        (remove
         nil?

     matched)))

(defn compile-ack-retry-lifecycle-functions [lifecycles task-name kw]
  (let [matched (select-applicable-lifecycles lifecycles task-name)
        fns (keep (fn [lifecycle]
                    (let [calls-map (resolve-lifecycle-calls (:lifecycle/calls lifecycle))]
                      (if-let [g (get calls-map kw)]
