DRYed the code for project forms