Model and events refactoring