LPS-43061 fix the collection API so it's more maintainable