     class Events
 
     _.extend Events::, Backbone.Events
-
-
-    # Light wrapper for fixing attrs for the top-level branch node. If `attrs`
-    # has ID fields, it is added as a child to the branch. This is primarily
-    # to fix legacy data that did not conform to this structure.
-    _fix = (node, attrs, options) ->
-        if attrs.concept? or attrs.field?
-            node.children.add(attrs, options)
-        else
-            node.set(attrs, options)
 
 
     class ContextTreeManager extends Events

        toJSON: (options) ->
            @_toJSON(@working, options)

        # Update the active and working trees. Nodes may not be removed from
        # the working tree since this would remove local state that controls
        # may be relying on.
        update: (attrs) ->
            # Ensure the active and working trees are not empty, otherwise
            # change events do not fire.
            attrs = _.extend
                children: []
                type: 'and'
            , attrs

            # Update `upstream` tree with server response
            _fix @upstream, attrs,
                manager: @
                identKeys: @options.identKeys
                validate: false

            # Augment the `working` tree with the server's response. Prevent
            # nodes from being removed
            _fix @working, attrs,
                manager: @
                identKeys: @options.identKeys
                validate: false

            @upstream = new nodes.BranchNodeModel null,
                manager: @

            # Set trees with  and any time a successful sync occurs
            @set(@model.get('json'))

            @model.on 'sync', (model, resp, options) =>
                @set(resp.json)

        # Traverses the working tree and extracts all applied nodes and
        # falls back to the upstream contents.
