Applying patterns to collection