Code Cleanup and Events changed