references cleanup