added event tests and refactored the others