Move all code to FormHelper