Refactor out code for generating URIs from names.