refactor to  eventjs