I see the point, but in this case I think it's quite clear to follow even with some repetition. Moreover, this function is not reused elsewhere so it's probably not worth the effort.