       listenersForCommand.splice(listenersForCommand.indexOf(listener), 1)
       if listenersForCommand.length is 0
         delete @listenersByCommandName[commandName]
-        @rootNode.removeEventListener(commandName, @handleCommandEvent, true)
+        @removeCommandListener(@rootNode, commandName)
 
   # Public: Find all registered commands matching a query.
   #


    matched

class CommandListener
  enabled: true


    @setRootNode(rootNode) # restore listeners for commands in snapshot

  handleCommandEvent: (originalEvent) =>
    originalEvent.__handledByCommandRegistry = true

    propagationStopped = false
    immediatePropagationStopped = false
    matched = false
