Refactoring buttons interactions