packages: Coding style

Adding return in the first if is a little bit easier to read than a big
else