refactoring student attendance