remove dead code and fix warnings