Refactored add_job for a cleaner implementation.