refactor to allow collection validation