optimize getseq process