working on per-type serialization but making some other changes that I want to cherry pick