simplify update logic