Refactored GradeAnalysis, slightly less ugly