Improvements to QueryBuilder