Cleanup of thermostat module

Cleanup of thermostat module