refactoring temperature_robot.rb