[refactoring] Improved loop