Could you break out some parts of this form into a partial? There seems to be a lot of repeated code happening here.