     for machineList in @machineLists
       machineList.selectMachineAndWorkspace machine.uid, workspace.slug
 
-    # data = @latestWorkspaceData or {}  unless data
-    # { workspace, machine } = data
-
-    # return if not machine or not workspace
-
-    # tree = @machineTree
-
-    # for key, node of tree.nodes
-    #   nodeData         = node.getData()
-    #   isSameMachine    = nodeData.uid is machine.uid
-    #   isMachineRunning = machine.status.state is Machine.State.Running
-
-    #   if node.type is 'machine'
-    #     if isSameMachine
-    #       if isMachineRunning
-    #         tree.expand node
-    #       else
-    #         tree.selectNode node
-    #         @watchMachineState data
-    #     else
-    #       tree.collapse node
-
-    #   else if node.type is 'workspace'
-    #     if isMachineRunning and nodeData.machineLabel is (machine.slug or machine.label)
-    #       slug = nodeData.data?.slug or KD.utils.slugify nodeData.title
-    #       tree.selectNode node  if slug is workspace.slug
-
-    # @latestWorkspaceData = data
-
-    # localStorage, what a good name, acet!
-    # localStorage = KD.getSingleton("localStorageController").storage "IDE"
-
-    # minimumDataToStore =
-    #   machineLabel     : machine.slug or machine.label
-    #   workspaceSlug    : workspace.slug
-    #   channelId        : data.channelId
-
-    # localStorage.setValue 'LatestWorkspace', minimumDataToStore
-
-
-  # watchMachineState: (data) ->
-
-  #   {workspace, machine} = data
-
-  #   @watchedMachines  or= {}
-
-  #   {Running} = Machine.State
-
-  #   return  if @watchedMachines[machine._id]
-
-  #   callback = (state) =>
-  #     return  if state.status isnt Running
-
-  #     machine.status.state = Running
-  #     delete @watchedMachines[machine._id]
-
-  #     if data is @latestWorkspaceData
-  #       @selectWorkspace data
-
-  #   kd.getSingleton 'computeController'
-  #     .on "public-#{machine._id}", callback
-
-  #   @watchedMachines[machine._id] = yes
-
 
   # TODO: Rename this method to fetchEnvironment - acet!
   fetchMachines: (callback) ->
 
     environmentDataProvider.fetch (data) =>
       callback data
-
-
-    # {computeController} = KD.singletons
-
-    # force refetch from server everytime machines fetched.
-    # computeController.reset()
-    # computeController.fetchMachines (err, machines)=>
-    #   if err
-    #     return new KDNotificationView title : 'Couldn\'t fetch your VMs'
-
-    #   callback machines
-
-
-
-
-  # addVMTree: ->
-
-  #   @addSubView section = new KDCustomHTMLView
-  #     tagName  : 'section'
-  #     cssClass : 'vms'
-
-  #   @machineTree = new JTreeViewController
-  #     type                : 'main-nav'
-  #     treeItemClass       : NavigationItem
-  #     addListsCollapsed   : yes
-
-  #   @machineTree.getView().unsetClass 'kdscrollview'
-
-  #   # This is temporary, we will create a separate TreeViewController
-  #   # for this and put this logic into there ~ FIXME ~ GG
-  #   @machineTree.dblClick = (nodeView, event)->
-  #     machine = nodeView.getData()
-  #     if machine.status?.state is Machine.State.Running
-  #       @toggle nodeView
-
-  #   section.addSubView header = new KDCustomHTMLView
-  #     tagName  : 'h3'
-  #     cssClass : 'sidebar-title'
-  #     partial  : 'VMs'
-  #     click    : @bound 'handleMoreVMsClick'
-
-  #   header.addSubView new CustomLinkView
-  #     cssClass : 'add-icon buy-vm'
-  #     title    : ' '
-
-  #   section.addSubView @machineTree.getView()
-
-  #   @machineTree.on 'NodeWasAdded', (machineItem) =>
-  #     machineItem.on 'click', @lazyBound 'handleMachineItemClick', machineItem
-
-  #   if KD.userMachines.length
-  #   then @listMachines (new Machine machine: (KD.remote.revive machine) for machine in KD.userMachines)
-  #   else @fetchMachines @bound 'listMachines'
 
 
   addMachineList: ->

    environmentDataProvider.revive()

    mainController.ready =>
      whoami().on 'NewWorkspaceCreated', @bound 'newWorkspaceCreated'


  # event handling

    @itemsByName  = {}
    @selectedItem = null

    # @appsList = new DockController

    router
