Refactor dispatcher for form