Support various types of refs