extract repeat method to module