refactored repeat / clone to work properly