   activate: (state) ->
     d 'activate'
     @moduleManager = new ModuleManager
+    @disposables = new CompositeDisposable
     @watchers = []
 
-    atom.workspace.observeTextEditors @onCreated
-    atom.commands.add 'atom-text-editor', @renameCommand, @onRename
-    atom.commands.add 'atom-text-editor', @doneCommand, @onDone
+    @disposables.add atom.workspace.observeTextEditors @onCreated
+    @disposables.add atom.commands.add 'atom-text-editor', 'refactor:rename', @onRename
+    @disposables.add atom.commands.add 'atom-text-editor', 'refactor:done', @onDone
 
   deactivate: ->
     @moduleManager.destruct()

      watcher.destruct()
    delete @watchers

    atom.workspaceView.off @renameCommand, @onRename
    atom.workspaceView.off @doneCommand, @onDone

  serialize: ->


Watcher = require './watcher'
ModuleManager = require './module_manager'
{ CompositeDisposable } = require 'atom'
{ packages: packageManager } = atom
d = (require 'debug/browser') 'refactor'

module.exports =
new class Main

  config:
    highlightError:
