Simplify (refactor) state chart:

Simplified the statechart by handling the "input" event in the "search-box" state instead of in each substate.