More simplified query implementation