refactoring grade_records