Thermometer related logic moved to a separate file.