Finished refactoring GenerationContext