remove more for loops