Eliminating duplicate/unnecessary queries.