refactoring jobs_controller