AST reorganization