Remove some dead code, simplify things