simple serialization refactor