clean the AST