code cleanup and my events