Extensive refactoring and new repeater test