Why duplicate this code? Is it just to make the if-block shorter?