Update data, add event type switch function, and various other minor changes