refactor PathFinder