refactor to extract resolve-sub-super-types