fairly large clean up