remove C++11 range-based for loops