Optimize the logic of project rename.