refactor WeightSet to a non-template