move duplicate var assignment in to a let block