     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))

              (keyword? x)
              (let [[method pathvec verb-fn middleware & nested-table] entry]
                (if nested-table
                  (into [[method pathvec verb-fn
                          (or middleware default-middleware)]]
                    (unnest-table pathvec nested-table))
                  (cond-> [entry]
                    (nil? middleware) (assoc-in [0 3] default-middleware))))


  ([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)
