remove code duplication class_name_to methods