rewrite most of the parsing, cleaning generated code
use allocate method and remove the lambda wrapper