Refactor path conversion