clean up unused code and fix or disable broken tests