refactor create new user and login