Implemented data_events option
Cleaned up render