refine the login