Changes and removes residual code