implement sequence serialization primitives