small factoring out of common functionality of iname construction