moved the code back from QueryBuilder to IA

TODO: remove the class quantifiers