Cleaning up the group management code.