Use ref instead of weakref