Simplify the pattern optimization