remove where from query for speed improvement