Moved reading of command line params out of routine that can be run remote