more reference cleanup