Modularised the form code.