refactored auth driver