Implemented a query builder in Lookup