Maybe not part of that PR, but we should really extract that path parsing logic in a common place so that clients do not have to know the inner details (and avoid duplication)