Fix user group management. Start using res modules