refactor: main AST refactor