Actions such as closing an item, should be placed in the searchBoxAction inner class, so a developer can override them, although it is possible to override it the way is now, I think its better pattern to place it in the inner class, look at how other actions such as handleClick are implemented