It seems like this could just use the version of putValues that takes an iterator... right? then you could drop the lines above this also.