Make xref tag more convenient, update code docs