Refactor comparison operators so that user can define what gets compared