Restructure on types