Suggest factoring this into a function used by structs, enums, and enum members.