For loop refactoring.