shift enum parsing out of generator