Move recurse function a level upward for a less nested function.
Use model in pathType options.