Added autocreation of the cache directory
Formatting