dir refactoring