And businesses see very less value in refactoring a working code
Right refactoring isn't the goal in itself, it's a means to an end.
What value it delivers is:
(CC[A], A => B) => Map[B, CC[A]]. But that doesn't work if
Iterator. (It's unlikely to be usable with that signature, and you can't compute it lazily so even though it looks like an iterator operation, actually the original iterator is completely evaluated to create the
groupedFrometc method with a signature
(IterableOnce[A], A => B) => Map[B, CC[A]]