refactor Find_project_root function