cleanup get_ref