refactoring checkSequence and create other files to modularize