refactor: untangle worker choosing code from worker creation code