A little bit better solution

Since this code is identical in both cases, we can merge this into this one case after the if-clause.