Refactoring update and create methods