Added more internal caching.