The short (and not really satisfactory) answer is "I copied the pattern from the resources/facts code."

Will look into it further.