Refactor events

[749c0994827036c11be2353168c49d7a905e350c]