bug fixes on auth module
more refactors