StreamRecord serialization improvement