Revert "patch the loop to be comptible with 0.9."

over optimisation for now. Keep the design simpler, don't introduce complexity.

This reverts commit b39f183b5a11f8d91cf2fd08f10d44a017eadd05.