Dead code cleanup, logging rearrange.