move temp/humidity to private function