More refactoring user auth.

Reduce method complexity