moved queryTemplating