Segment serialization WIP