restructure types