Refactor grade_levels helper