Move unmarshalling code out of parser, into individual type files