Refactors code in PetitionsController#create