Improving function names and simplifying code
Renaming function DirectoryExists to DirExists