refactored temperature plugin