refactor button_press_cb callback