Refactoring repair api