Remove unnecessary pattern match