Add optimize pattern decorator.