refactoring: move common methods to job_worker_util.rb, update test for worker