Added pathfinding factory and uses it in map