refactoring CollectionHelper