Refine the login view logic