refactor user_groups controller