refactored path resolution