better formating for queries