 (defn- make-node
   "Given a path-spec segment string and a payload object, return a new
   tree node."
-  [segment o]
+  [segment data]
   (cond
     (wild-param? segment)
-    (wild-node segment (keyword (subs segment 1)) nil o)
+    (wild-node segment (keyword (subs segment 1)) nil data)
 
     (catch-all-param? segment)
-    (catch-all-node segment (keyword (subs segment 1)) nil o)
+    (catch-all-node segment (keyword (subs segment 1)) nil data)
 
     :else
-    (static-node segment nil o)))
+    (static-node segment nil data)))
 
 (defn- new-node
   "Given a path-spec and a payload object, return a new tree node. If
   the path-spec contains wildcards or catch-alls, will return parent
   node of a tree (linked list)."
-  [path-spec o]
+  [path-spec data]
   (if (contains-wilds? path-spec)
     (let [parts (partition-wilds path-spec)]
       (reduce (fn [child segment]

                common (subs path-spec 0 lcs)]
            (if (= common segment)
              (let [path-spec (subs path-spec (inc lcs))]
                (insert-child node (subs path-spec 0 1) path-spec o))
              (throw (ex-info "route conflict"
                              {:node node
                               :path-spec path-spec

        segment)
      (update-segment [this subs lcs]
        (static-node (subs segment lcs) children data))
      (set-data [this data]
        (static-node segment children data))
      (add-child [this key child]
        (static-node segment (assoc children key child) data))
      (insert-child [this key path-spec child-data]
        (static-node segment (update children key insert path-spec child-data) data)))))

(defn- wild? [s]
  (contains? #{\: \*} (first s)))
