outsourced variable/loop-stack stuff to new class ParsingUtils