I inlined the function, had to keep the match since the `getOrElse` was giving me some trouble with the types.