Why the "if" here? You could compare all other types (maybe there are new ones in the future?) by string.