Code polish.
Improved event system.