Change all ::ptr to ::ref