Clean up the setbutton function