refactor out a collection module