Use collections.defaultdict() where applicable