replace reference with contexted calls