Replace unnecessary loops with dict.update calls
Replace .items() and .keys() calls with iterators, when appropriate