Remove deprecated field instrument_sub_type
Move grouping logic into query function