Refactoring. Created utility function isOppositeCond()