Changed cache to a member variable. Refactored into a common method while getting channel values by time.