re-organized such that this is only a query builder