Rewrite as structs