more authentication cleanup stuff, finally happy with it