directorytools refactoring