replace spaces and underscores with dashes in class name