refactory Login