     { label, queryString, ipAddress } = options
     { r: { group, user, account } } = client
 
-    if err = isValid { queryString, ipAddress }
-      return callback err
+    { err } = validate { queryString, ipAddress }
+    return callback err  if err
 
     queryString = getKiteIdOnly queryString
     provider    = @providerSlug

KONFIG            = require('koding-config-manager').load("main.#{argv.c}")


isValid = ({ ipAddress, queryString, storage }) ->

  if ipAddress? and (ipAddress.split '.').length isnt 4
    return new KodingError 'Provided IP is not valid', 'WrongParameter'

  if queryString? and (queryString.split '/').length isnt 8
    return new KodingError 'Provided queryString is not valid', 'WrongParameter'

  if storage? and isNaN +storage
    return new KodingError 'Provided storage is not valid', 'WrongParameter'

  return null

getKiteIdOnly = (queryString) ->
  "///////#{queryString.split('/').reverse()[0]}"

      return callback new KodingError \
        'A valid machineId and an update option is required.', 'WrongParameter'

    { err } = validate { ipAddress, queryString, storage }
    return callback err  if err

    fieldsToUpdate = {}

