Adding more code for local and remote job execution.