refactor sensor update method