shift type parsing out of generator
shift token parsing out of generator