extract new method from create and update