Better query formatting