In the new API it would be great if we have a query builder instance for a query.  Hence, functions won't care if they are being called from another function that builds queries or not.  For this fix, it is OK to keep to fix minimal.