 
     productForm = new VmProductForm
 
-    paymentController = KD.getSingleton 'paymentController'
-
-    KD.whoami().fetchPlansAndSubscriptions ['vm'], (err, plansAndSubscriptions) =>
+    pay = KD.getSingleton 'paymentController'
+
+    KD.whoami().fetchPlansAndSubscriptions ['vm'], (err, plansAndSubs) =>
       return  if KD.showError err
       
-      { subscriptions } = paymentController
-                            .groupPlansBySubscription plansAndSubscriptions
+      { subscriptions } = pay.groupPlansBySubscription plansAndSubs
 
       productForm.setCurrentSubscriptions subscriptions
 
     productForm.on 'PackOfferingRequested', (subscription) ->
       options = targetOptions: selector: tags: 'vm'
+
       KD.getGroup().fetchProducts 'pack', options, (err, packs) ->
         return  if KD.showError err
         

    KD.remote.api.JVM.fetchDefaultVm callback

  createDefaultVM: (callback)->

    @hasDefaultVM (err, state)->
      return warn 'Default VM already exists.'  if state


      width   : 500
      overlay : yes

    workflow
      .on('DataCollected', @bound 'provisionVm')
      .on('Cancel', modal.bound 'destroy')
      .enter()

  provisionVm: ({ subscription, paymentMethod, productData })->

    { JVM } = KD.remote.api

    { plan, pack } = productData
      
    if paymentMethod and not subscription

      return plan.subscribe paymentMethod.paymentMethodId, (err, subscription) =>
        return  if KD.showError err

        @provisionVm { subscription, productData }

    subscription.debit pack, (err, nonce) ->
      return  if KD.showError err

      JVM.createVmByNonce nonce, (err, vm) ->
        return  if KD.showError err

        debugger

  askForApprove:(command, callback)->

