cleanup serialization refactoring