code cleanup for events