Refactored class name generation.