refactored editing and updating studentgroups