Add some infrastructure around the latest ref