Migrating unmarshalling code to package