refactor LoginService