refactor therm