moved pattern into data-pattern
Several intermediate changes