improved abstraction in the update method