shift global variable parsing out of generator