Delete defunct code and clean up