I also thought about it when I wrote the code. if you look at the code than we repeat one line of code (but it still gets executed only once). But I thought that the overall logic is better if we separate the two main cases at the beginning. I think this makes it also easier to understand the code if we look at it again in a few months.