Use inner classes to handle events.