authentications code refactor, dissociate