- add method for folding state cheking
- refactoring