continue foreach refactoring work from pr #135
and commitid 15d668e9689beebb1a56e42c3076df27542c50de