Completed ref substitution