Refactor sign up/in process