Sensor related functions moved to a separate file.