events refactor wip