improve for create and update