Improved the event/render flow