move _pattern to local variable to pattern