[Seq] Code refactor and bug solving