fix warnings (unused imports)
rewrite module StateMachine