Revert "Refactoring loop, to reduce filesize footprint"

This reverts commit 009fa0cacbc19f0a26cfed0b2843c81444ea3099.