Changed pattern to template