remove the duplicated setOutputDirectory() call
refactor the environment for debuging the remote mode