refactored comparison operations