Simplifying attribute generation with range-based for loops. No functional changes intended.