Better caching method.