Small refactoring before works on merging jobs and queues.