refactor the grouping of pitch type and number of pitches thrown