shift struct parsing out of generator