deleteCollection and start refactoring