Refactored serialization context