Refactoring student attendance summary