Refactoring of the auth component