Moved update_groups logic out of controller.
Removed useless variable assignment.