   serialize: ->
 
   login: ->
-    LoginView ?= require './views/login-view'
-    @loginView ?= new LoginView()
+    @LoginView ?= require './views/login-view'
+    @loginView ?= new @LoginView()
     # You may ask why this isn't in LoginView? This way, we don't need to
     # require/initialize login view until it's needed.
     atom.workspaceView.command 'spark-ide:cancel-login', => @loginView.cancelCommand()
     @loginView.show()
 
   logout: ->
-    if !SettingsHelper.isLoggedIn()
-      return
-
-    LoginView ?= require './views/login-view'
-    @loginView ?= new LoginView()
+    if !@SettingsHelper.isLoggedIn()
+      return
+
+    @LoginView ?= require './views/login-view'
+    @loginView ?= new @LoginView()
 
     @loginView.logout()
 
   selectCore: ->
-    SelectCoreView ?= require './views/select-core-view'
-    @selectCoreView ?= new SelectCoreView()
-
-    if !SettingsHelper.isLoggedIn()
+    @SelectCoreView ?= require './views/select-core-view'
+    @selectCoreView ?= new @SelectCoreView()
+
+    if !@SettingsHelper.isLoggedIn()
       return
 
     @selectCoreView.show()
 
   renameCore: ->
-    RenameCoreView ?= require './views/rename-core-view'
-
-    if !SettingsHelper.isLoggedIn()
-      return
-
-    if !SettingsHelper.hasCurrentCore()
-      return
-
-    @renameCoreView ?= new RenameCoreView(SettingsHelper.get 'current_core_name')
+    @RenameCoreView ?= require './views/rename-core-view'
+
+    if !@SettingsHelper.isLoggedIn()
+      return
+
+    if !@SettingsHelper.hasCurrentCore()
+      return
+
+    @renameCoreView ?= new @RenameCoreView(@SettingsHelper.get 'current_core_name')
     @renameCoreView.attach()
 
   removeCore: ->
-    if !SettingsHelper.isLoggedIn()
-      return
-
-    if !SettingsHelper.hasCurrentCore()
-      return
-
-    removeButton = 'Remove ' + SettingsHelper.get('current_core_name')
+    if !@SettingsHelper.isLoggedIn()
+      return
+
+    if !@SettingsHelper.hasCurrentCore()
+      return
+
+    removeButton = 'Remove ' + @SettingsHelper.get('current_core_name')
     buttons = {}
     buttons['Cancel'] = ->
 
-    buttons['Remove ' + SettingsHelper.get('current_core_name')] = =>
+    buttons['Remove ' + @SettingsHelper.get('current_core_name')] = =>
       workspace = atom.workspaceView
-      ApiClient = require './vendor/ApiClient'
-      client = new ApiClient SettingsHelper.get('apiUrl'), SettingsHelper.get('access_token')
-      @removePromise = client.removeCore SettingsHelper.get('current_core')
+      @ApiClient = require './vendor/ApiClient'
+      client = new @ApiClient @SettingsHelper.get('apiUrl'), @SettingsHelper.get('access_token')
+      @removePromise = client.removeCore @SettingsHelper.get('current_core')
       @removePromise.done (e) =>
         if !@removePromise
           return
         atom.workspaceView = workspace
-        SettingsHelper.clearCurrentCore()
+        @SettingsHelper.clearCurrentCore()
         atom.workspaceView.trigger 'spark-ide:update-core-status'
         atom.workspaceView.trigger 'spark-ide:update-menu'
 

    localStorage.setItem('compile-status', JSON.stringify({working: true}))
    atom.workspaceView.trigger 'spark-ide:update-compile-status'

    ApiClient = require './vendor/ApiClient'
    client = new ApiClient SettingsHelper.get('apiUrl'), SettingsHelper.get('access_token')

    # Including files
    fs ?= require 'fs-plus'


  activate: (state) ->
    # Require modules on activation
    @StatusView ?= require './views/status-bar-view'
    @SettingsHelper ?= require './utils/settings-helper'
    @MenuManager ?= require './utils/menu-manager'

    # Initialize views
    @statusView = new @StatusView()

    # Hooking up commands
    atom.workspaceView.command 'spark-ide:login', => @login()
