Refactor: fix code smells.

Reduce complexity as suggessted by code climate.
Merge pull request #25 from nlf/develop

Refactor: fix code smells.