We should probably cache this map as it's used twice here.