moved repeat() to util class