Remove dead code, fix formatting