better abstraction for records of values