 
     shouldReviveProvider ?= yes
 
-    {provider, credential, provisioners} = options
+    { provider, credential, provisioners } = options
 
     if shouldReviveProvider
       if not provider or not provider_ = PROVIDERS[provider]
-        return callback new KodingError "No such provider.", "ProviderNotFound"
+        return callback new KodingError 'No such provider.', 'ProviderNotFound'
       else
         provider_.slug   = provider
         options.provider = provider_
 
-    reviveClient client, (err, revivedClient)=>
+    reviveClient client, (err, revivedClient) =>
 
       return callback err       if err
       client.r = revivedClient  if revivedClient?


      # This is a fallback mechanism and valid only for production. ~ GG
      if group.slug is 'koding'
        {ObjectId} = require 'bongo'
        group.stackTemplates = [ObjectId "53fe557af052f8e9435a04fa"]
        console.error "[critical] Koding group template is not set!"
      else
        return callback new KodingError "Template not set", "NotFound"

    # TODO Make this works with multiple stacks ~ gg
    stackTemplateId = group.stackTemplates[0]

    # TODO make all these in seperate functions
    JStackTemplate = require "./stacktemplate"
    JStackTemplate.one { _id: stackTemplateId }, (err, template)->

      if err
        console.warn "Failed to fetch stack template for #{group.slug} group"
        console.warn "Failed to create stack for #{user.username} !!"
        return callback new KodingError "Template not set", "NotFound", err

      if not template?
        console.warn "Stack template is not exists for #{group.slug} group"
        console.warn "Failed to create stack for #{user.username} !!"
        return callback new KodingError "Template not found", "NotFound", err

      checkTemplateUsage template, account, (err)->
        return callback err  if err?

        res.template = template
        callback null, res


guessNextLabel = (options, callback)->

  {user, group, provider, label} = options

  return callback null, label  if label?


  #   console.log "[UNLOCKER] User #{nickname} was not locked, nothing to do."


revive = do -> (
  {
    shouldReviveClient
    shouldPassCredential
    shouldReviveProvider
