Refactored user group management.