remove a lot of dead code