* use class for state machine
+ add new files for state machine