Add support for union and serialization