refac AST inheritance tree