Use prettier/more efficient for loop