minor refactorings regarding caching