Optimizations for contexts