Make query patterns generator more readable