Refactoring and acceptance tests for the JobManager