Rewrite query to be somewhat more useful