Remove dead code, clean up label replacement method