optimize repo's construction