single function for ref type