Enhanced template rendering using ES6 generators