refactor SeqPattern