Implemented simple straightforward scope reuse in foreach