Transitioned core AST class hierarchy to templated scheme