refactoring ast