class for patterns