remove unused code, and fix for clang++ compile