Refactor the logic used to fetch RRD values.