Basic support for repeat (before refactoring)