Reduced redundancy in the ButtonHandler