Refactoring jobcontroller