 
 (defn atomic-template [value]
   (cond
-    (nil? value) (template (pref :span) (pref :nil-style) (pref :nil-label))
-    (bool? value) (template (pref :span) (pref :bool-style) value)
+    (nil? value) (template :span :nil-style :nil-label)
+    (bool? value) (template :span :bool-style value)
     (string? value) (string-template value)
     (number? value) (number-template value)
-    (keyword? value) (template (pref :span) (pref :keyword-style) (str value))
-    (symbol? value) (template (pref :span) (pref :symbol-style) (str value))
-    (fn? value) (template (pref :span) (pref :fn-style) (reference value))))
+    (keyword? value) (template :span :keyword-style (str value))
+    (symbol? value) (template :span :symbol-style (str value))
+    (fn? value) (template :span :fn-style (reference value))))
 
 (defn abbreviated? [template]
   (some #(= (pref :more-marker) %) template))


(defn wrap-group-in-reference-if-needed [group obj]
  (if (abbreviated? group)
    #js [(reference (surrogate obj (.concat (template (pref :span) "") group)))]
    group))

; default printer implementation can do this:

    (aget config "prevent-recursion")))

(defn template [tag style & children]
  (let [resolve-pref (fn [pref-or-val] (if (keyword? pref-or-val) (pref pref-or-val) pref-or-val))
        tag (resolve-pref tag)
        style (resolve-pref style)
        js-array #js [tag (if (empty? style) #js {} #js {"style" style})]]
    (doseq [child children]
      (if (coll? child)
        (.apply (aget js-array "push") js-array (into-array child)) ; convenience helper to splat cljs collections
        (.push js-array (resolve-pref child))))
    js-array))

(defn reference
