Refactoring repeat to collection and list, bugfixes