refactores authentication mode cases