Refactor sign in form