removed lot of dead code