Slight improvements to generator perf