That handler is all good for now. But it's best if functions have only a single responsibility. Each function should have one and only one reason for change. The handler for example, only had to worry about passing on the button from the event.
It's like in business. When you have a person that has multiple masters, that person ends up in trouble because he cannot keep both of them happy at the same time.