Moved ref to class level