Refactor and improve login and register views