improve nullable serialization