cleaner design for QueryProcessor, some gui work