refactored event addition.