Refactored sets into structs to use generic functions over value types