Simplifying count query.