simplify for range loop