Use set logic to generate dict.