Added the Reduce method to cut unnecessary queries