refactored auth a bit to solve a module dependency issue