Refactor button clicks