Various path-related refactoring