Define a record for :ref which we can use in a more OO manner