     if typeof(runner.configuration.hooksData) != 'object' or Array.isArray(runner.configuration.hooksData) != false
       return callback(new Error("hooksData option must be an object e.g. {'filename.js':'console.log(\"Hey!\")'}"))
 
-    # run code in sandbox
+    # Run code in sandbox
     async.eachSeries Object.keys(runner.configuration.hooksData), (key, nextHook) ->
       data = runner.configuration.hooksData[key]
 
-      # run code in sandbox
+      # Run code in sandbox
       sandboxHooksCode data, (sandboxError, result) ->
         return nextHook(sandboxError) if sandboxError
 
-        # merge stringified hooks
+        # Merge stringified hooks
         runner.hooks = mergeSandboxedHooks(runner.hooks, result)
 
         # Fixing #168 issue

      # If other language than nodejs, run hooks worker client
      # Worker client will start the worker server and pass the "hookfiles" options as CLI arguments to it
      else
        # start hooks worker
        hooksWorkerClient = new HooksWorkerClient(runner)
        hooksWorkerClient.start callback

    # Loading files in sandboxed mode
    else

      # load sandbox files from fs
      logger.info('Loading hook files in sandboxed context:', files)
      async.eachSeries files, (fileName, nextFile) ->
        resolvedPath = path.resolve((customConfigCwd or process.cwd()), fileName)
        # load hook file content
        fs.readFile resolvedPath, 'utf8', (readingError, data) ->
          return nextFile(readingError) if readingError
          # run code in sandbox
          sandboxHooksCode data, (sandboxError, result) ->
            return nextFile(sandboxError) if sandboxError
            runner.hooks = mergeSandboxedHooks(runner.hooks, result)

mergeSandboxedHooks = require './merge-sandboxed-hooks'
HooksWorkerClient = require './hooks-worker-client'

# Ensure platform agnostic path.basename function
basename = if process.platform is 'win32' then path.win32.basename else path.basename

addHooks = (runner, transactions, callback) ->
  # Note: runner.configuration.options must be defined
