Better reuse of 'repeat' method
Fixing typo
Adding tests