I would use two dictionaries instead of using a single dictionary keyed by a tuple, especially because, later in the code, you need to extrct only the sources of a given type.