Minor complexity optimizations + code organization

According to #193, here's the PR that refacto some parts of the lib: condition simplifications, better variable naming, better exception message building, etc.

Feedback and contribution is very welcomed.

Thanks,