Refactor table update method