Remove copied and unused code