Refactor grade levels helper