made Ref covariant in its type parameter