performance enhancement - caching files for isDirectory() performance improvements