   ([obj opt-map]
      (let [sw (StringWriter.)
            generator (.createJsonGenerator
-                      ^JsonFactory (or *json-factory* json-factory) sw)]
+                      ^JsonFactory (or factory/*json-factory*
+                                       factory/json-factory) sw)]
        (when (:pretty opt-map)
          (.useDefaultPrettyPrinter generator))
        (when (:escape-non-ascii opt-map)
          (.enable generator JsonGenerator$Feature/ESCAPE_NON_ASCII))
-       (generate generator obj
-                 (or (:date-format opt-map) default-date-format)
-                 (:ex opt-map))
+       (gen/generate generator obj
+                     (or (:date-format opt-map) factory/default-date-format)
+                     (:ex opt-map))
        (.flush generator)
        (.toString sw))))
 

  ([obj opt-map]
     (let [baos (ByteArrayOutputStream.)
           generator (.createJsonGenerator ^SmileFactory
                                           (or *smile-factory* smile-factory)
                                           baos)]
       (generate generator obj (or (:date-format opt-map) default-date-format)
                 (:ex opt-map))
       (.flush generator)
       (.toByteArray baos))))

  and returning the collection to be used for array values."
  [^bytes bytes & [key-fn array-coerce-fn]]
  (when bytes
    (parse/parse
     (.createJsonParser ^SmileFactory (or factory/*smile-factory*
                                          factory/smile-factory) bytes)
     key-fn nil array-coerce-fn)))

(def ^{:doc "Object used to determine end of lazy parsing attempt."}
