use hash with indifferent access for sort_mappings to avoid memory leaks