Rework pathfinding.