some dead code removed