Optimize update method