Refactored button handlers
Merge