Refactored auth methods.