   isPackageInstalled: (packageName) ->
     if atom.packages.isPackageLoaded(packageName)
       true
-    else if packageNames = @getAvailablePackageNames()
-      packageNames.indexOf(packageName) > -1
     else
-      false
+      atom.packages.getAvailablePackageNames().indexOf(packageName) > -1
 
   packageHasSettings: (packageName) ->
     grammars = atom.grammars.getGrammars() ? []


  constructor: ->
    @packagePromises = []
    @availablePackageCache = null
    @apmCache =
      loadOutdated:
        value: null

        else
          atom.packages.loadPackage(name)

        callback?()
        @emitPackageEvent 'installed', pack
      else
