refactoring of fors on ModelCompare