Dead code cleanup and some renaming.