Working on refactoring AST