Queries refactored