Refactor typeinfo.