Refactor event init