Refactor all_names