added some ref type functionality