simplifying the update logic