better implementation in __search_usr_and_rename_refs()