Refactoring managing of student groups for teachers