Improved serialization.