refactor UserVariable serialization