changing the format of events
refactors sqlite logic to work with new events