Some event binding refactoring