REFACTOR errors handling

No need to use an else in most `if err != nil` blocks.
Simplify code where it uses it.

REF #6