Add outer scope variable iterator.
Refactor variable iterators