cleanup dead code, formatting