working on decreasing the amount of queries