 #       http://blog.stevenlevithan.com/archives/faster-than-innerhtml
 
 # delay or invoke job immediately
-delay = (el, job) ->
+delay = (job) ->
     # only when tag is ready
-    if el._jquery?
+    if @_jquery?
         do job
     else
-        el._jquery_delay ?= []
-        el._jquery_delay.push(job)
+        @_jquery_delay ?= []
+        @_jquery_delay.push(job)
+
 
 jqueryify = (tpl) ->
     tpl.xml._jquery = $()

                return # dont return emit result (which is either true or false)

    tpl.on 'text', (el, text) ->
        delay el, ->
            el._jquery.text(text)


    tpl.on 'attr', (el, key, value) ->
        delay el, ->
            el._jquery.attr(key, value)

    tpl.on 'attr:remove', (el, key) ->
        delay el, ->
            el._jquery.removeAttr(key)

    tpl.on 'remove', (el) ->

                do job
            delete el._jquery_delay
        # insert into parent
        delay.call el.parent, ->
            if el.parent is tpl.xml
                el.parent._jquery = el.parent._jquery.add(el._jquery)
            else
