Restructure as methods on types.