     @subscriptions.dispose()
 
   comb: ->
-    @showNotifications = atom.config.get('css-comb.showNotifications') && atom.notifications && atom.notifications.addInfo
+    filePath = atom.workspace.getActivePaneItem().getPath()
+    config = @_getConfig(filePath)
 
-    filePath = atom.workspace.getActivePaneItem().getPath()
+    @_processFile(filePath, config)
 
+  #
+  # PRIVATE
+  #
+
+  _processFile: (filePath, config) ->
+    comb = new CSScomb(config)
+    comb.processFile(filePath)
+
+    if @_showNotifications()
+      atom.notifications.addInfo('File processed by csscomb')
+
+  _showNotifications: ->
+    atom.config.get('css-comb.showNotifications') && atom.notifications && atom.notifications.addInfo
+
+  _getConfig: (filePath) ->
     if !atom.config.get('css-comb.shouldNotSearchConfig')
       configPath = path.join(path.dirname(filePath), '.csscomb.json')
       configPath = CSScomb.getCustomConfigPath(configPath)
 
     if configPath
-      @processFile filePath, require(configPath)
+      return require(configPath)
     else
       configPath = atom.config.get('css-comb.customConfig')
 
       if configPath && fs.existsSync(configPath)
-        @processFile filePath, require(configPath)
+        return require(configPath)
       else
-        @processFile filePath, CSScomb.getConfig(atom.config.get('css-comb.predef'))
-
-  processFile: (filePath, config) ->
-    comb = new CSScomb(config)
-    comb.processFile(filePath)
-
-    if @showNotifications
-      atom.notifications.addInfo('File processed by csscomb')
-
-module.exports = new Comb
+        return CSScomb.getConfig(atom.config.get('css-comb.predef'))

      type: 'boolean'
      default: true

  subscriptions: null
  showNotifications: true

  activate: (state) ->
    # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable


{CompositeDisposable} = require 'atom'

module.exports =
  #
  # CONFIG
  #

  config:
    shouldNotSearchConfig:
