refactor sensorDemo