refactor duplicate question grouping