shift function parsing out of generator