Changed to use discriminator