But why do you keep ref here? It's not used any further, is it? It's just a bit confusing to me: The comment suggests there's more (magic?) to it than there is.