eliminate dead code, formatting fixes