Moving generators to templates