adding some internal caching