Minor loop body refactoring