Implementing name-based ref resolution.