Define a helper function to avoid having repeated chunck of code.
Define a helper function to avoid having repeated chunck of code.

googleinterns/sensor-historian,googleinterns/sensor-historian,googleinterns/sensor-historian,googleinterns/sensor-historian,googleinterns/sensor-historian