   response transformations."
   [^DefaultContext context callback]
   (let [^Response response (:response context)]
-    (.beforeSend response (helpers/action callback))))
+    (.beforeSend response (ch/fn->action callback))))

  "Functions and helpers for work in a clojure
  way with ratpack types."
  (:require [catacumba.utils :as utils]
            [catacumba.impl.helpers :as helpers])
  (:import ratpack.handling.Handler
           ratpack.handling.Context
           ratpack.handling.RequestOutcome

  when the connection with the client is closed."
  [^DefaultContext context callback]
  (let [^Context ctx (:catacumba/context context)]
    (.onClose ctx (ch/fn->action callback))))

(defn before-send
  "Register a callback in the context that will be called
