       virtual-dom
 
       :default
-      (let [  ;;virtual-dom (normalize-virtual-element virtual-dom)
-            node (create-dom-node (first virtual-dom))
+      (let [node (create-dom-node (first virtual-dom))
             state (init-element-state! node elem-spec)
             attrs? (second virtual-dom)
             attrs (when (map? attrs?) attrs?)

            ;(println "build")
            (build-element new-elem-spec))
          (build-element new-elem-spec))]
    (register-element-with-parent parent new-elem)
    (.replaceChild parent new-elem cur-dom-node)
    (dispose-node cur-dom-node)
    new-elem))

(declare replace-child)

            (.toString attr-value))
          "")))))

(defn- bind-lifecycle-callback! [element cb-name cb-value node-state]
  (case cb-name
    "attached"
    (set! (.-node-attached node-state) cb-value)

    "disposed"
    (set! (.-disposed-callback node-state) cb-value)
    nil))

(defn- bind-attr! [element attr-name attr-value node-state]
  (let [attr-ns (namespace attr-name)
        attr-name (name attr-name)]
    (if attr-ns
      (case attr-ns
        "node"
        (bind-lifecycle-callback! element attr-name attr-value node-state)
        nil)
      (cond
        (identical? "style" attr-name)
        (bind-style! element attr-value node-state)

        (identical? 0 (.indexOf attr-name "on-"))
        (bind-event-listener! element (.substring attr-name 3) attr-value node-state)

        :default
        (bind-prop-attr! (get-attr-setter element attr-name)
                         element attr-name attr-value node-state))))

  (defn- dispose-child-state [node-state child-key]
    (when-let [child-states (.-child-states node-state)]
      (when-let [state (aget child-states child-key)]
        (set! (.-disposed state) true)
        (when-let [disposed-callback (.-disposed-callback state)]
          (disposed-callback))
        (js-delete child-states child-key)))))

(defn- unbind-attr!* [node-state prefix attr-name]
  (let [attr-key (str "-" prefix "." attr-name)]
