Improve serialization process