minor refactoring: dir -> path