     
     makeElements = (nodes) =>
       $list = $("<ul/>")
-      $list.addClass(@treeClass())
+      $list.addClass(@_treeClass())
       $list.append(makeElement(node)) for node in nodes
       $list
     
     $(@element).empty()
     $(@element).append(makeElements(structure))
     this
+    
+  _nodeClass: () -> @options.classPrefix+"node"
+  _treeClass: () -> @options.classPrefix+"tree"
   
-  nodeClass: () -> @options.classPrefix+"node"
-  treeClass: () -> @options.classPrefix+"tree"
-
-  typeClass: (typeName) ->
-    @options.classPrefix+@options.typePrefix+typeName
+  _typeClass: (typeName) ->
+    @options.classPrefix+'type-'+typeName
     
-  stateClass: (state) ->
-    @options.classPrefix+state+  _stateClass: (state) ->
+    @options.classPrefix+state

    .#{@idClass} ul {
      list-style-type: none;
    }
    .#{@idClass} ul li.#{@nodeClass()} {
      cursor: pointer;
    }
    .#{@idClass} ul li.#{@nodeClass()}:before {
      width: 1em;
      text-align: center;
      display: inline-block;

    makeElement = (node) =>
      $li = $("<li/>")
      $li.text(node.name)
      $li.addClass(@_nodeClass())
      $li.addClass(@_typeClass(node.type ? 'default'))
      $li.attr("data-#{k}", v) for k, v of node.attributes
      if (node.children ? []).length == 0
        $li.addClass(@_stateClass('leaf'))
      else
        expandedClass = @_stateClass('expanded')
        $li.click (e) ->
          if this == e.target
            $(this).toggleClass(expandedClass)
