Query Pre Processor