separated subprocess command to global function