more concise dict loop