Remove unused code and clean up.