Factor out common collection code, and use it to create a JobCollection.