start refactoring collection setup logic