code refactoring in send updates about sensors