refactor sign up and sign in