   items = @items
   settings = getSettings()
   template = @
-  refreshTree(@)
+  @refreshTree = _.debounce(loadTree, 100)
+  @refreshTree(@)
 
 TemplateClass.destory = ->
   _.each @checkboxes, ($checkbox) ->

          # There is a significant memory leak caused by re-loading the entire tree after each
          # change (e.g. if a node is added to the root node). Hence, we recreate the entire tree
          # just once after all updates are complete.
          refreshTree(template)
          return
        sortResults = getSortedIndex(template, newDoc)
        nextSiblingNode = sortResults.nextSiblingNode

  template.readyDf.resolve()
  setUpReactiveUpdates(template)

setUpReactiveUpdates = (template) ->
  return if template.isReactiveSetup

