Split out collection modules, some refactoring