Restructure findPath callback.