Clean up some query builder helpers