refactor events and improve JAvaDocs