Streamlined repeat functions into single file