Remove events when not needed.