Cleaned up code for add_job.