io - refactored path logic