Removed some dead code and unused references