Refactored event handling.
Refactored event handling.
Layout.