improvments of queries