We should annotate this with `scala.annotation.tailrec`