Factor out redundant code in resource collections