Refactor path API.