Made both updates and creates use the same code