Add ref shorthand function
Put the ref tests under the same function