For '_replace_all_refs', added some comments