cannot simplify generated code: why???