Refactor the execution into multiple jobs, and deal with error handling