Added support for layering patterns and parameterized pattern arguments