Refactored the temperature component