simplify getOpType by using Enum's static function valueOf