Refactor handle password form.