Sorry, I was too fast say this is fine. I missed the fact that you forgot to change `def outputGroups` to `val outputGroups` so `outputAsMap.toArray.map` logic is not rerun on every invocation.