Improved the queries.