directorytools refactoring
directorytools.py refactoring