Better ordering of information. Grab the settings, which could be missing, before attempting to run the job. Also update the status during the operation and report completion.
Cleanup the shared environment before trudging foreward.