Refactored dir to path