Re-organize classes and tweak events.