Adds framework for 3 part queries