       { permission: 'delete own stack', validateWith: Validators.own }
     ]
 
-    success: (client, callback)->
+    success: (client, callback) ->
 
       # TODO Implement delete methods.
-      @update $set: status: "Terminating"
-
-      JProposedDomain  = require "./domain"
-      JMachine = require "./computeproviders/machine"
+      @update { $set: { status: 'Terminating' } }
+
+      JProposedDomain  = require './domain'
+      JMachine = require './computeproviders/machine'
 
       { delegate } = client.connection
 
-      @domains?.forEach (_id)->
-        JProposedDomain.one {_id}, (err, domain)->
+      @domains?.forEach (_id) ->
+        JProposedDomain.one { _id }, (err, domain) ->
           if not err? and domain?
-            domain.remove (err)->
+            domain.remove (err) ->
               if err then console.error \
                 "Failed to remove domain: #{domain.domain}", err
 
-      @machines?.forEach (_id)->
-        JMachine.one {_id}, (err, machine)->
+      @machines?.forEach (_id) ->
+        JMachine.one { _id }, (err, machine) ->
           if not err? and machine?
-            machine.remove (err)->
+            machine.remove (err) ->
               if err then console.error \
                 "Failed to remove machine: #{machine.title}", err
 
       Relationship.remove {
-        targetName : "JStackTemplate"
+        targetName : 'JStackTemplate'
         targetId   : @baseStackId
         sourceId   : delegate.getId()
-        sourceName : "JAccount"
-        as         : "user"
-      }, (err)=>
+        sourceName : 'JAccount'
+        as         : 'user'
+      }, (err) =>
 
         @remove callback
 


  @some$ = permit 'list stacks',

    success: (client, selector, options, callback)->

      [options, callback] = [callback, options]  unless callback
      options ?= {}

      callback null, stack


  @getSelector = (client, selector) ->

    { delegate } = client.connection
    { group }    = client.context

    selector ?= {}
    selector.originId = delegate.getId()
    selector.status   = { $ne: 'Terminated' }
    selector.group    = group

    return selector
