renamed sequenceFactory to createPattern