Refactor modallogin