refactor execute_job and monitor_job