looks like .getOrElseUpdate. Can you use that if so, makes it easier to reason about what is happening.