more events code cleanup