         xpath (str xpath (if idx (format "[%s]" idx) ""))]
     xpath))
 
-(defn q-expand [driver q]
+(defn q-expand
+  "Expands a query expression into a pair of
+   [locator, term] values to pass them into low-level HTTP API."
+  [driver q]
   (cond
     (string? q)
     [(:locator @driver) q]

(defn get-status [driver]
  (with-resp driver :get
    [:status]
    nil
    resp
    (:value resp)))

(defn create-session [driver]

;; URL and title
;;

(defn get-url
  "Returns the current URL string."
  [driver]
  (with-resp driver :get
    [:session (:session @driver) :url]
    nil resp
    (:value resp)))

(defn get-title
  "Returns the current window's title."
  [driver]
  (with-resp driver :get
    [:session (:session @driver) :title]
    nil resp
