Use File for path2project and clean code #1544