simplified pattern match