Split Generator.execute() into prepare() and build_kernel()
Improve code documentation