More efficient way to produce key-value pairs out of data and the set of variable names