Refactor PathFinder