Add processQuery function for convinience