make ref func