shift function body parsing out of generator