Refactored QueryParser