Refactored GenerationContext