Improve unserialize so that it can use a discriminator field