changing query decoder generalization using inner classes