refacoring, added repetition test