ref and thread stubs