refactor ia_ransac code