some slight refactoring and adding test coverage regarding adding workgroup users to cohorts