clean up the AST