     # Take this to a better place, possibly to payment controller.
     makePayment = (type, hostname, plan, callback)->
       planCode = plan.code
-      cpuSize  = plan.item.meta.cpu
       if type is 'shared'
         group = KD.singletons.groupsController.getCurrentGroup()
         group.checkPayment (err, payments)->

                  if err
                    onError err
                  else
                    vmController.createGroupVM type, hostname, cpuSize, vmCreateCallback
                    onSuccess()
                    callback()
              paymentModal.on "KDModalViewDestroyed", -> vmController.emit "PaymentModalDestroyed"
          else
            group.updatePayment {plan: planCode}, (err, subscription)->
              vmController.createGroupVM type, hostname, cpuSize, vmCreateCallback
              callback()
      else
        _createUserVM = (cb)->
          KD.remote.api.JRecurlyPlan.getPlanWithCode planCode, (err, plan)->
            plan.subscribe {}, (err, subscription)->
              return cb err  if cb and err
              vmController.createGroupVM type, hostname, cpuSize, vmCreateCallback
              cb?()
        KD.remote.api.JRecurlyPlan.getUserAccount (err, account)->
          if err

    if not currentGroup or currentGroup is 'koding' then "koding~#{KD.nick()}"
    else currentGroup

  createGroupVM:(type='personal', planCode, callback)->
    defaultVMOptions =
      planCode       : planCode
    group = KD.singletons.groupsController.getCurrentGroup()

    group.createVM {type}, callback

  fetchVMs:(callback)->
    return callback null, @vms  if @vms.length > 0
