implemented ast refactorings