A Map of Pair<> to Pair<> can get a little unwieldy for the understanding of the code.  How about we introduce holder classes with meaningful names for each of the Pair<>s?