First part of the job graph refactoring