           :default
           (do-bind-attr (get-attr-setter element attr-name) attr-value))))))
 
-;; (defn- bind-styles! [node old-state style-map]
-;;   (attr-diff* node old-state style-map bind-style!))
-
-;; (defn- bind-events! [node old-state evt-map]
-;;   (attr-diff* node old-state evt-map bind-event!))
-
 (def ^:private bind-attrs! (wrap-attr-map-binder bind-attr!))
-
-(def ^:private enable-diffing false)
-
-(defn enable-diffing!
-  "Enables experimental diffing support."
-  ([] (enable-diffing! true))
-  ([enable] (set! enable-diffing enable)))
-
-(def ^:private ^:dynamic *diff-head* nil)
-
-(defn- get-diff-head* []
-  (when-let [head *diff-head*]
-    (set! *diff-head* (.-nextSibling head))
-    head))
-
-(defn- get-diff-head []
-  (when-let [head (get-diff-head*)]
-    (or (get-element-state head)
-        (UnmanagedDOMNode. head nil nil))))
 
 (deftype DOMElement [ns-uri tag ^:mutable attrs children ^:mutable node
                      ^:mutable parent ^:mutable attr-binder]

  (-velem-simple-element [this] this)
  (-velem-insert [this vparent vnext-sibling]
    (set! parent vparent)
    (if-let [diff-head (get-diff-head)]
      (ui/velem-replace this diff-head)
      (do
        (.ensureNode this)
        (dom-insert parent node vnext-sibling)
        (.onAttached this)))
    this)
  (-velem-take [this]
    (dom-remove node)) 
  (-velem-replace [this old-velem]
    (if-let [old-simple (ui/velem-simple-element old-velem)]
      (when-not (.diffReplace this old-simple)
        (.ensureNode this)
        (dom-simple-replace node (ui/velem-native-element old-simple))
        (r/dispose old-velem))
      (do
        (.ensureNode this)
        (dom-remove-replace node old-velem)))
    (.onAttached this)
    this)
  (-velem-lifecycle-callback [this cb-name]


  Object
  (dispose [this]
    (r/dispose attr-binder)
    (doseq [i (range (.-length children))]
      (r/dispose (aget children i))))
  (ensureNode [this]
    (when-not node
