fix various things reported by inspection
remove some more unused stuff