Move form logic to form controller.