REFACTOR errors handling

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

REF #6
Merge pull request #7 from MaximeD/refactor-switches-on-errors

REFACTOR errors handling