Refactor sign-in form