steps toward full use of Type
Type and Entity big refactor