some caching improvements