begin refac of type and expression tree