avoid range-based for