     (hiccup->arb (html->hiccup html)))
     (hiccup->arb (html->hiccup html as-fragment))))
 
-(defn arb->tx [arb]
-  (let [[arb-tag metadata & value] arb]
-    (if (and
-          (= 1 (count value))
-          (or (string? (first value)) (nil? (first value))))
-      {:arb/metadata [{:metadata/html-tag (metadata :original-tag)}]
-       :arb/value [{:content/text (first value)}]}
-      (loop [values []
-             items value]
-        (def new-val (if (string? (first items))
-                       {:content/text (first items)}
-                       (arb->tx (first items))))
-        (if (= 1 (count items))
-          {:arb/metadata [{:metadata/html-tag (metadata :original-tag)}]
-           :arb/value (conj values new-val)}
-          (recur (conj values new-val) (next items)))))))
-
-(defn html->tx [html & metadata]
-  (let [tx (-> html (html->arb) (arb->tx))]
-    (assoc tx :arb/metadata (into (:arb/metadata tx) metadata))))
-
 (defn tx->arb [tx]
   (let [{metadata :arb/metadata value :arb/value} tx]
     (if (and (= 1 (count value)) (not (nil? (:content/text (first value)))))


(defn get-in-metadata [k metadata]
  (k (first (filter #(k %) metadata))))

(defn html->hiccup
  ([html] (as-hiccup (parse html)))

                         (:content/text (first items)) ;; If it's not an arb it must be a :content/text
                         (tx->arb (first items)))) (next items)))))))

(defn html->tx [html & metadata]
  (let [tx (-> html (html->arb) (arb->tx))]
    (assoc tx :arb/metadata (into (:arb/metadata tx) metadata))))

(defn tx->html [tx]
  (-> tx (tx->arb) (arb->hiccup) (html)))
