Getting rid of query dependency