Factory for creating subtypes