Optimised Queries

@nadeeshaan Please provide us a testing Instructions or steps for your several commits.
@nadeeshaan Please fix this line.