same as above, but additionally iterating over same Map isn't necessary.