refine type hierarchy