Remove redundant pattern match