refactor utils: put events in separate file