Refactor event and base component module