       @statusBarManager.initialize(@statusBar)
       @statusBarManager.attach()
 
-  initRegistries: (Base)->
+  initVimClassRegistry: (Base)->
     toggle = @toggle.bind(this)
     class QuickHighlight extends Base.getClass('Operator')
       flashTarget: false
       stayAtSamePosition: true
 
       mutateSelection: (selection) ->
-        toggle(@editor, selection.getText())
+        toggle(selection.getText())
 
     class QuickHighlightWord extends QuickHighlight
       target: "InnerWord"
 
-    registries = {}
-    for klass in [QuickHighlight, QuickHighlightWord]
-      registries[klass.name] = klass
-    registries
+    return {QuickHighlight, QuickHighlightWord}
 
   consumeVim: ({Base, registerCommandFromSpec}) ->
-    registries = null
-    getClass = (name) =>
-      registries ?= @initRegistries(Base)
-      registries[name]
-
-    commandPrefix = 'vim-mode-plus-user'
-    spec = {commandPrefix, getClass}
+    classes = null
+    commandSpec =
+      commandPrefix: 'vim-mode-plus-user'
+      getClass: (name) =>
+        classes ?= @initVimClassRegistry(Base)
+        classes[name]
 
     @subscriptions.add(
-      registerCommandFromSpec('QuickHighlight', spec),
-      registerCommandFromSpec('QuickHighlightWord', spec)
+      registerCommandFromSpec('QuickHighlight', commandSpec)
+      registerCommandFromSpec('QuickHighlightWord', commandSpec)
     )

    order: 1
    type: 'boolean'
    default: true
    description: """
    [Require Restart]<br>
    This value is checked on startup.<br>
    When disabled quick-highlight delay startup IO( files to load by require ) for faster activation<br>
    """

    @subscriptions = new CompositeDisposable
    @emitter = new Emitter
    @viewByEditor = new Map
    @subscriptions.add atom.commands.add 'atom-text-editor:not([mini])',
      'quick-highlight:toggle': => @toggle()
      'quick-highlight:clear': => @keywordManager?.clear()

    @subscriptions.add atom.config.observe 'quick-highlight.highlightSelection', (value) =>
      if value
        @initQuickHighlightIfNeeded()

  deactivate: ->
    @keywordManager?.destroy()
    @keywordManager = null

    @viewByEditor.forEach (view) -> view.destroy()
    @viewByEditor.clear()
    @viewByEditor = null

    @subscriptions.dispose()
    @subscriptions = null

    @editorSubscription?.dispose()
    @editorSubscription = null

    @statusBarManager?.detach()
    @statusBarManager = null

  getCursorWord: (editor) ->
    selection = editor.getLastSelection()
