Several Changes to the library

Changed the way the library treats the events and keep the events data.