Replace iterators with range based for