hooks for custom serialization