added event sub methods and refactored the code for module inclusion