 
 
   executeRemote = (process, self) ->
-    remoteExecution = new RemoteExecution(nconf.get('remoteServer:ip'),nconf.get('remoteServer:user'))
     async.waterfall [
       (callback) ->
-        remoteExecution.uploadFile(process.image.path, process.rootFolder, callback)
+        @remoteExecution.uploadFile(process.image.path, process.rootFolder, callback)
       (callback) ->
         command = buildRemoteCommand(process)
         process.id = Statistics.startRecording(process.req.originalUrl, process)
         command += ' ' + process.id + ' ' + process.rootFolder + ' > /dev/null'
-        remoteExecution.executeCommand(command, callback)
+        @remoteExecution.executeCommand(command, callback)
     ], (err) ->
       self.emit('processingFinished')
 

        process.rootFolder = collection.name
        process.image = image
        collection.processes.push(process)
    callback null, collection

  preprocessIiif = (collection, req, callback) ->
    url = req.body.images[0].value


# Expose executableHelper
executableHelper = exports = module.exports = class ExecutableHelper extends EventEmitter
  @remoteExecution = new RemoteExecution(nconf.get('remoteServer:ip'),nconf.get('remoteServer:user'))

  # ---
  # **constructor**</br>
