improvements to attr queries