Create and use a type instead of an anonymous struct