Updated query class for readability