refactor repair functions