     xs))
 
 (defn prepare-handler-bindings
-  "Used by compile-dispatch-table."
+  "Used by handler-form."
   [request-sym arglist route-params non-route-params]
-  (mapcat (fn [param]
-            [param
-             (if (contains? route-params param)
-               `(get (:route-params ~request-sym) ~(keyword param))
-               `(internals/extract-argument-value
-                  ~(keyword param)
-                  ~request-sym
-                  (-> ~request-sym :rook :arg-resolvers)))])
-    arglist))
+  (let [route-param? (set route-params)]
+    (mapcat (fn [param]
+              [param
+               (if (route-param? param)
+                 `(get (:route-params ~request-sym) ~(keyword param))
+                 `(internals/extract-argument-value
+                    ~(keyword param)
+                    ~request-sym
+                    (-> ~request-sym :rook :arg-resolvers)))])
+      arglist)))
 
 (defn apply-middleware-sync [middleware sync? handler]
   (middleware handler))

  ([ns-sym]
     (namespace-dispatch-table [] ns-sym))
  ([context-pathvec ns-sym]
     (namespace-dispatch-table context-pathvec ns-sym default-middleware))
  ([context-pathvec ns-sym middleware]
     (try
       (if-not (find-ns ns-sym)

  (:require [clojure.core.match :refer [match]]
            [clojure.string :as string]
            [clojure.pprint :as pp]
            [clojure.set :as set]
            [io.aviso.rook :as rook]
            [io.aviso.rook.async :as rook-async]
            [io.aviso.rook.internals :as internals]
