Initial support for events and refactoring.