Auth checks refactoring

Refactoring auth checks using a single check_auth() function. This improves the module readability and maintainability
Merge pull request #9 from dgilm/patch-1

Enh: Auth checks refactoring