Extract inlining stuff
Extract discriminator cache generation
Remove the valid member
Some cleanup