refactored deserialization
refactored serialization