refactored event binding into modules