refactor saving cached version of data, and handling of data delivered from ucc
refactor event data generation into function