added events to window class
also improved event class performance.