Optimize serialization.