compile, some code cleanups, but unfortunately gtest does not pass