Improve login method