[#42950875] refactored element_name_to_index method