functional add/remove ref