Improve login controller