Added simple caching for computed values of a context
refactoring, better naming