10-15% more performance goodness, caching files to avoid isDirectory()