Reduce duplication in update and create controller actions