Pattern matching in refName