Code clean up and cashed the directory separator.
Code clean up