refactored conflict logic