moved caching code to the sensorbase class.