Changed the approach to cache directories