Refactors the group name loading into a service.