Removed duplicated code

The code in the if-branches always made the same, so I guess it increases the readability a bit when it's moved on top.