added template methods to handle comparison relations