Serialization for ttl, and clean up of serialazation