Refactor state machine for simplicity and easier operation
Merge pull request #1 from c-base/lesskeys

Refactor state machine for simplicity and easier operation