improve test query