Remove duplicated check logic and incorrect return type

No match.