A small PR to reduce some of the code duplication between the various branches, make it a little more readable and move the API closer to what we already have for `KnownClass`
A small PR to reduce some of the code duplication between the various branches, make it a little more readable and move the API closer to what we already have for `KnownClass`