cleanup
optimization necessary to make firefox responsive.