Refactor css class name generation.