optimize queries for speed..